How to send email to a single line text variable with Notification activity workflow

imhicham
Tera Contributor

i just try this  : 

 

***********************

var emailID = current.variables.e_mail_perso_de_l_utilisateurs ;
answer = [emailID];

 ***********************

but not working, any suggestion ?

1 ACCEPTED SOLUTION

Maddysunil
Kilo Sage

@imhicham 

 

// Retrieve the email address from the single-line text variable
var emailID = current.variables.e_mail_perso_de_l_utilisateurs;

// Check if the email address is valid
if (emailID) {
    // If the email address is valid, send the email notification
    gs.eventQueue('email.send', current, 'Notification', 'notification.template', emailID, 'Test subject', 'Test message');
    answer = 'Email sent to ' + emailID;
} else {
    // If the email address is empty or invalid, handle the error
    answer = 'Error: No valid email address found';
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

View solution in original post

6 REPLIES 6

Maddysunil
Kilo Sage

@imhicham 

 

// Retrieve the email address from the single-line text variable
var emailID = current.variables.e_mail_perso_de_l_utilisateurs;

// Check if the email address is valid
if (emailID) {
    // If the email address is valid, send the email notification
    gs.eventQueue('email.send', current, 'Notification', 'notification.template', emailID, 'Test subject', 'Test message');
    answer = 'Email sent to ' + emailID;
} else {
    // If the email address is empty or invalid, handle the error
    answer = 'Error: No valid email address found';
}

 

Please Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks

imhicham
Tera Contributor

thank you it's working