Email Notification

1
0
-1

Hello everyone,

I tried to send notifications to email and have been successfully sent, the process I do is Vacation Request, and I'm need to send notifications when rejected or approved the request, but must be you customize notifications must carry information on what has entered the user name, dates chosen, among others. All this information is stored in my data model.
Should display in the mail something like the following:

Dear [User], your Vacation Request has been approved.
Start Date [date chosen by the user]
Final date [date chosen by the user]

Any idea or an example of how could, greatly appreciate your help.

Regards,
 
Victor

3 answers

1
+2
-1
This one is the BEST answer!

In you mail connector use a script to build the body text, something like this:

  1. StringBuilder body = new StringBuilder();
  2.  
  3. body.append("Dear "+myBdm.getFirstName()+",");
  4. body.append(....etc.);
  5.  
  6. return body.toString();

Regards
Seán

PS:as this answers your question, please mark as resolved.

1
0
-1

Hi Séan, after using the script which worked well, I started has to try to create a block of impressions to make the notification in an email using line breaks, but I have not got, I researched and I have used several commands as printn, '\ n' new line, among others, both Java and Groovy and continues by printing in a single block. You know how to do this, need some library in my script? Thanks for your help, regards.

Comments

Submitted by Sean McP on Tue, 08/16/2016 - 01:45

You need to make sure you check the box for HTML in the email body (it's on a page somewhere) and do not use '\ n' - because your email is now in HTML use '< /br >' (removing the spaces...

regards

Submitted by vgonzalez_3 on Tue, 08/16/2016 - 22:29

I tried it and it works correctly, thank you very much for your help Seán, regards.

1
0
-1

Thanks for your reply Seán, it worked very well, thank you very much for your help.

Notifications