You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Avijit Bose <bo...@gmail.com> on 2022/06/10 12:56:18 UTC

BIRT Email

Dear Sir,

I am sending BIRT email as follows:
-------------------------------------------
dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
            "sendTo", supplierEmail,
            "sendCc", sendCc,
            "sendFrom", sendFrom,
            "subject", subject,
            "bodyText", body,
            "contentType", "text/html",
                    "attachmentName", attachmentName,
                    "birtReportLocation", birtReportLocation,
                    "birtParameters", map,
                    "userLogin", userLogin
                    ));
-------------------------------------------

Question: I am unable to send email body in HTML format. The above
"contentType", "text/html", is not working. When sending as "bodyText",
body, ... I am able to get the body in email but email body is showing up
as plain text.

Pls let me know how could I send email body as HTML format in BIRT Email.

regards
Avijit

Re: BIRT Email

Posted by Avijit Bose <bo...@gmail.com>.
Definitely Sir,

1. My BIRT email sending java portion is...
---------------------------------------
//This is for BIRT report email with attachment
            dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
                    "sendTo", supplierEmail,
                    "sendCc", sendCc,
                    "sendFrom", sendFrom,
                    "subject", subject,
                    "bodyText", body,                        //NOTE
HERE....I HAVE USED "bodyText" INSTEAD OF "body". ALL OTHER KEYS  ARE SAME
                    "attachmentName", attachmentName,
                    "birtReportLocation", birtReportLocation,
                    "birtParameters", map,
                    "userLogin", userLogin
                    ));
---------------------------------------

2. In the BIRT services.xml file, I have added ' allow-html="any" ' tag as
shown below...
--------------------------------------
<!--BIRT Email Services -->
    <service name="sendBirtMail" engine="java"
location="org.apache.ofbiz.birt.email.BirtEmailServices"
invoke="sendBirtMail">
        <description>BIRT Email Service</description>
        <implements service="sendMailInterface"/>
        <attribute name="bodyText" type="String" mode="IN" optional="true"
allow-html="any"/> // THIS IS BODYTEXT I USED...   allow-html="any"
        <attribute name="bodyScreenUri" type="String" mode="IN"
optional="true"/>
        <attribute name="birtReportLocation" type="String" mode="IN"
optional="false"/>
        <attribute name="attachmentName" type="String" mode="IN"
optional="false"/>
        <attribute name="bodyParameters" type="Map" mode="IN"
optional="true"/>
        <attribute name="birtParameters" type="Map" mode="IN"
optional="true"/>
        <attribute name="birtLocale" type="Locale" mode="IN"
optional="true"/>
        <attribute name="birtContentType" type="String" mode="IN"
optional="true"/>
        <attribute name="webSiteId" type="String" mode="IN"
optional="true"/>
        <attribute name="body" type="String" mode="OUT" optional="false"/>
// THIS BODY IS NOT CARRYING MY EMAIL BODY
    </service>
---------------------------------------

Hope this might be helpful to others.

regards
Avijit

On Mon, Jun 13, 2022 at 12:12 PM Daniel Watford <da...@foomoo.co.uk> wrote:

> Hi Avijit,
>
> Please could you follow up with how you solved your issue. It will add to
> the body of ofbiz knowledge and help those who might have similar issues in
> the future.
>
> Thanks,
>
> Dan.
>
> On Sat, 11 Jun 2022 at 04:04, Avijit Bose <bo...@gmail.com> wrote:
>
> > I have solved it.
> >
> > regards
> > Avijit
> >
> > On Sat, Jun 11, 2022 at 8:15 AM Avijit Bose <bo...@gmail.com>
> wrote:
> >
> > > Dear Sir,
> > >
> > > In connection to my previous email, I am getting the below mentioned
> > > error. Pls let me know how can I solve this.
> > >
> > > The Following Errors Occurred:
> > >
> > > Unable to send email:
> > org.apache.ofbiz.service.ServiceValidationException:
> > > In field [bodyText] less-than (<) and greater-than (>) symbols are not
> > > allowed.
> > >
> > > On Fri, Jun 10, 2022 at 6:26 PM Avijit Bose <bo...@gmail.com>
> > wrote:
> > >
> > >> Dear Sir,
> > >>
> > >> I am sending BIRT email as follows:
> > >> -------------------------------------------
> > >> dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
> > >>             "sendTo", supplierEmail,
> > >>             "sendCc", sendCc,
> > >>             "sendFrom", sendFrom,
> > >>             "subject", subject,
> > >>             "bodyText", body,
> > >>             "contentType", "text/html",
> > >>                     "attachmentName", attachmentName,
> > >>                     "birtReportLocation", birtReportLocation,
> > >>                     "birtParameters", map,
> > >>                     "userLogin", userLogin
> > >>                     ));
> > >> -------------------------------------------
> > >>
> > >> Question: I am unable to send email body in HTML format. The above
> > >> "contentType", "text/html", is not working. When sending as
> "bodyText",
> > >> body, ... I am able to get the body in email but email body is showing
> > up
> > >> as plain text.
> > >>
> > >> Pls let me know how could I send email body as HTML format in BIRT
> > Email.
> > >>
> > >> regards
> > >> Avijit
> > >>
> > >>
> > >>
> >
>
>
> --
> Daniel Watford
>

Re: BIRT Email

Posted by Daniel Watford <da...@foomoo.co.uk>.
Hi Avijit,

Please could you follow up with how you solved your issue. It will add to
the body of ofbiz knowledge and help those who might have similar issues in
the future.

Thanks,

Dan.

On Sat, 11 Jun 2022 at 04:04, Avijit Bose <bo...@gmail.com> wrote:

> I have solved it.
>
> regards
> Avijit
>
> On Sat, Jun 11, 2022 at 8:15 AM Avijit Bose <bo...@gmail.com> wrote:
>
> > Dear Sir,
> >
> > In connection to my previous email, I am getting the below mentioned
> > error. Pls let me know how can I solve this.
> >
> > The Following Errors Occurred:
> >
> > Unable to send email:
> org.apache.ofbiz.service.ServiceValidationException:
> > In field [bodyText] less-than (<) and greater-than (>) symbols are not
> > allowed.
> >
> > On Fri, Jun 10, 2022 at 6:26 PM Avijit Bose <bo...@gmail.com>
> wrote:
> >
> >> Dear Sir,
> >>
> >> I am sending BIRT email as follows:
> >> -------------------------------------------
> >> dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
> >>             "sendTo", supplierEmail,
> >>             "sendCc", sendCc,
> >>             "sendFrom", sendFrom,
> >>             "subject", subject,
> >>             "bodyText", body,
> >>             "contentType", "text/html",
> >>                     "attachmentName", attachmentName,
> >>                     "birtReportLocation", birtReportLocation,
> >>                     "birtParameters", map,
> >>                     "userLogin", userLogin
> >>                     ));
> >> -------------------------------------------
> >>
> >> Question: I am unable to send email body in HTML format. The above
> >> "contentType", "text/html", is not working. When sending as "bodyText",
> >> body, ... I am able to get the body in email but email body is showing
> up
> >> as plain text.
> >>
> >> Pls let me know how could I send email body as HTML format in BIRT
> Email.
> >>
> >> regards
> >> Avijit
> >>
> >>
> >>
>


-- 
Daniel Watford

Re: BIRT Email

Posted by Avijit Bose <bo...@gmail.com>.
I have solved it.

regards
Avijit

On Sat, Jun 11, 2022 at 8:15 AM Avijit Bose <bo...@gmail.com> wrote:

> Dear Sir,
>
> In connection to my previous email, I am getting the below mentioned
> error. Pls let me know how can I solve this.
>
> The Following Errors Occurred:
>
> Unable to send email: org.apache.ofbiz.service.ServiceValidationException:
> In field [bodyText] less-than (<) and greater-than (>) symbols are not
> allowed.
>
> On Fri, Jun 10, 2022 at 6:26 PM Avijit Bose <bo...@gmail.com> wrote:
>
>> Dear Sir,
>>
>> I am sending BIRT email as follows:
>> -------------------------------------------
>> dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
>>             "sendTo", supplierEmail,
>>             "sendCc", sendCc,
>>             "sendFrom", sendFrom,
>>             "subject", subject,
>>             "bodyText", body,
>>             "contentType", "text/html",
>>                     "attachmentName", attachmentName,
>>                     "birtReportLocation", birtReportLocation,
>>                     "birtParameters", map,
>>                     "userLogin", userLogin
>>                     ));
>> -------------------------------------------
>>
>> Question: I am unable to send email body in HTML format. The above
>> "contentType", "text/html", is not working. When sending as "bodyText",
>> body, ... I am able to get the body in email but email body is showing up
>> as plain text.
>>
>> Pls let me know how could I send email body as HTML format in BIRT Email.
>>
>> regards
>> Avijit
>>
>>
>>

Re: BIRT Email

Posted by Avijit Bose <bo...@gmail.com>.
Dear Sir,

In connection to my previous email, I am getting the below mentioned error.
Pls let me know how can I solve this.

The Following Errors Occurred:

Unable to send email: org.apache.ofbiz.service.ServiceValidationException:
In field [bodyText] less-than (<) and greater-than (>) symbols are not
allowed.

On Fri, Jun 10, 2022 at 6:26 PM Avijit Bose <bo...@gmail.com> wrote:

> Dear Sir,
>
> I am sending BIRT email as follows:
> -------------------------------------------
> dispatcher.runSync("sendBirtMail", UtilMisc.toMap(
>             "sendTo", supplierEmail,
>             "sendCc", sendCc,
>             "sendFrom", sendFrom,
>             "subject", subject,
>             "bodyText", body,
>             "contentType", "text/html",
>                     "attachmentName", attachmentName,
>                     "birtReportLocation", birtReportLocation,
>                     "birtParameters", map,
>                     "userLogin", userLogin
>                     ));
> -------------------------------------------
>
> Question: I am unable to send email body in HTML format. The above
> "contentType", "text/html", is not working. When sending as "bodyText",
> body, ... I am able to get the body in email but email body is showing up
> as plain text.
>
> Pls let me know how could I send email body as HTML format in BIRT Email.
>
> regards
> Avijit
>
>
>