Forum Discussion
2 Replies
Replies have been turned off for this discussion
- _anomDiebolt_Qrew EliteTry this code:
Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=660
Notes:
(1) The function takes arguments email, subject and message and returns a promise which resolves when the email has been sent via the native method UserWin:function QBU_SendEmail(email, subject, message) {...}(2) You use the function in this fashion:var email = "[email protected]";
(3) The native UserWin method requires the userid (eg "51084879.bdbt") which is obtained by passing the user's email to API_GetUserInfo.
var subject = "Subject";
var message = "<h1>Hello ${firstName} ${lastName}</h1><p>Did you file your TPS Reports?</p>";
QBU_SendEmail(email, subject, message)
.then(function() {
//your further code here
});
(4) The message is passed as a very short template which can include references to tokens for the firstName and lastName. The message can also include HTML markup.
(5) If you intent to do bulk emails you can't just wrap a loop around this code as your browser will process the code as fast as possible and will eventually run out of sockets at which time the browser will lock up. One solution it to wrap the code in an async function. - EOMDeveleporsQrew CaptainThanks Dan. To clarify this will send it via quickbase and from address will be [email protected] and the reply to will be the users email address. I was looking to sent it via gmail user and password. But if that's not possible, this solution will definitely be helpful.
Thanks again.