Send a mail on specific condition
Hi,
I'm looking for a possibility to send an email to specifc accounts list based on certain dynamic criteria.
I.e.: Date1-Date2 < 2 then send email to XXXX
Thanks
Regs
SL
-
Hi Simone,
That should be possible by using a page-level JavaScript function. How many email addresses are there and do you have the conditions for each? You don't need to post specific details like the actual email addresses but I'm curious about the complexity of the decision-making needed in the function.
-
Simone,
Say you have a date element and you want to send to one of email address if it is before today and another if it is after. Your function could look something like:
function pickEmail(d) {
var today = new Date();
if(today < d) {
return "email_one@mail.com";
} else {
return "email_two@mail.com";
}
}Then in the dynamic value of the Email Element you would enter
pickEmail(date_dcn)
Where date_dcn is the data-column name of the Date element.
-
Simone,
The app functions as being client-side by nature; however, there are possibilities to integrate and develop server-side solutions. So far it sounds like you would be able to handle your needs natively client-side in the app, but I'm guessing the email criteria/conditions are a bit more complex. Do you have any other details that can help me understand your challenges more?
Please sign in to leave a comment.
Comments
6 comments