This topic is locked
[SOLVED]

Send Email - using sendEmailTemplate

1/13/2022 11:32:27 PM
ASPRunner.NET General questions
J
J Wright author

Hi All,

Does this function 'sendEmailTemplate' have options for attachment's and a BCC reciepient ?

XVar data = XVar.Array();
XVar record;
string email;
while(record = button.getNextSelectedRecord()) {
data.InitAndSetArrayItem(record["ID"], "ID");
data.InitAndSetArrayItem(record["Name"], "Name");
data.InitAndSetArrayItem(record["SamAccountName"], "Sam_Account_name");
data.InitAndSetArrayItem(record["Emailaddress"], "Email_address");
data.InitAndSetArrayItem(record["PasswordLastSet"], "Password_last_set");
email = record["EmailAddress"];
CommonFunctions.sendEmailTemplate(email, "password_reminder.txt", data, false);
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Like the runner_mail function

XVar attachments = XVar.Array();
// Attachments description. The 'path' is required. Others parameters are optional.
attachments = new XVar(
0, new XVar("path", MVCFunctions.getabspath("files/Choosing_a_secure_password.pdf"), "name", "Choosing_a_secure_password.pdf"),
1, new XVar("path", MVCFunctions.getabspath("files/Password_Changes_FAQ.pdf"), "name", "Password_Changes_FAQ.pdf"));

// send the email
XVar rmail = XVar.Array();
rmail["to"] = emails.ToString();
rmail["subject"] = "Information Services - Please change your DPIRD password when time allows";
rmail["htmlbody"] = htmlbody.ToString();
rmail["attachments"] = attachments;
var res = MVCFunctions.runner_mail(rmail);
result["txt"] = "Emails were sent.";

>>>>>>>>>>>>>>>>>>>>>>>>

Having to code the message body , like in runner_mail is annoying, if would be great to just use templates ?

Kind Regards
Johnathon

admin 1/14/2022

Johnathon,

we do not have this functionality right now but it sounds like a great suggestion and we will implement it at some point.

J
J Wright author 1/15/2022

Awesome :)