Question

Hyperlink or Attachment in BPM email

  • 25 February 2021
  • 3 replies
  • 488 views

Hi,

Is anyone aware of a way to either add an attachment or a hyperlink to a BPM Directive ‘Send Email’ function.

Regards,

Darryn


3 replies

Userlevel 3

Hi Darryn

Instead of using the inbuilt Send Email widget you can use a piece of custom code to send a HTML email using ice.mail.smtpmail()

//Create Variables
var tmailhandler = this.GetMailer(async:true);
var temail = new Ice.Mail.SmtpMail();
var tBody = "";

//Set Body of Email
tBody = "Email Body with <a href=\"https://www.google.com\">Google Link</a>";

//Address Elements
temail.SetTo("joe.bloggs@emailaddress.com");
temail.SetFrom("noreply@emailaddress.com");

//Subject & Body Elements
temail.SetSubject("Email Subject Line");
temail.SetBody(tBody);

//Other Flags
temail.IsBodyHtml = true;

//Send Email
tmailhandler.Send(temail);

This is from my toolbox and I haven’t used it for a while so you might need to play around with the code a little.

You could also write the body of the email directly to the temail.setbody(); rather than declaring it seperately. This was done for testing.

You should be able to include an attachment using 

temail.Attachments.Add(new Attachment(attachmentFilename));

//Where attachmentFilename is filename variable or string

Hi Tim,

Thank you, I will try that out.

Regards,

Darryn

Userlevel 3

Hi Tim,

Thank you, I will try that out.

Regards,

Darryn

Hi Darryn

How did you get on with this. Did it do what you need to?

Tim

Reply