Triggered-Email
Index
For this example you have to register first and log-in.
Triggered-Emails (in this example) can only be sent to registered (logged-in) users.
Triggered-Email
After submitting button, you will get a TEST-E-mail, this is a simulation of the TRIGGERED-Email-function.
Please do not forget to check your SPAM-FOLDER!
CODE
import wixUsers from 'wix-users';
import wixCrm from 'wix-crm';
$w.onReady(function () { });
//-----------------------------------------------------------------------------------------
export function button1_click(event) {send_Email ()}
//-----------------------------------------------------------------------------------------
function send_Email (parameter) {
let userId = wixUsers.currentUser.id;
let value1 = "russian-dima@hotmail.de"
console.log(userId)
console.log((value1))
wixUsers.emailUser("test", userId, {
"variables": {
"variable1": value1,
"variable2": "value for variable2"
}
} )
.then( () => {
console.log("Triggered email sent");
} )
.catch( (err) => {
console.log(err);
} );
console.log(("Job done!"))
$w('#BOX1').show()
$w('#TXT1').text="Triggered-Test-Mail succsselfully sent. Delivery in about 15sec."
setTimeout(()=>{$w('#BOX1').hide()},3500)
}