none
Mail Apps-Problem while adding content to the beginning of the mail item body using prependAsync() RRS feed

  • Question

  • Hi,

    I am facing an issue while adding some content to the new mail item body using "item.body.prependAsync()"

    When i am adding the plain text (.i.e KKK,XXX..etc) using the prependAsync() method, my text is adding to the body.

    But while adding the special characters in the text, my text is not appending to the body. It is not throwing any error message and asyncResult.status is also 'succeeded'

    Please check the below sample code.

     var metaDataTags = "<billinfo1:ONE><billinfo2:TWO>";
                item.body.prependAsync(
                                metaDataTags,
                                {
                                    coercionType: Office.CoercionType.Html,
                                    asyncContext: { var3: 1, var4: 2 }
                                },
                                function (asyncResult) {
                                    if (asyncResult.status == Office.AsyncResultStatus.Failed) {
                                        write(asyncResult.error.message);
                                    }
                                    else {
                                    }
                                });

    Any help can be appreciated.

    Regards,

    Kiran

    Tuesday, August 5, 2014 11:50 AM

Answers

  • You're using Office.CoercionType.Html, but it sounds like you want to use Office.CoercionType.Text instead in this case, assuming that the metaDataTags value is what you expect to see in the body as is, together with the angle brackets.
    Wednesday, August 6, 2014 3:03 AM

All replies

  • You're using Office.CoercionType.Html, but it sounds like you want to use Office.CoercionType.Text instead in this case, assuming that the metaDataTags value is what you expect to see in the body as is, together with the angle brackets.
    Wednesday, August 6, 2014 3:03 AM
  • Hi,

    Thanks for the reply.

    When i am using Office.CoercionType.Text metadata is adding to the body.

    Regards,

    Kiran

    Wednesday, August 6, 2014 6:38 AM