Fix completeProfile.cfm syntax error
Use mail() service inside cfscript instead of cfmail tag Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3ceedaa818
commit
c5ebb24b39
1 changed files with 14 additions and 10 deletions
|
|
@ -108,7 +108,7 @@ try {
|
|||
userId: { value: userId, cfsqltype: "cf_sql_integer" }
|
||||
}, { datasource: "payfrit" });
|
||||
|
||||
// Send confirmation email
|
||||
// Send confirmation email (non-blocking - don't fail if mail fails)
|
||||
confirmLink = "https://biz.payfrit.com/confirm_email.cfm?UUID=" & qUser.UserUUID;
|
||||
emailBody = "
|
||||
<p>Welcome to Payfrit, #firstName#!</p>
|
||||
|
|
@ -118,19 +118,23 @@ try {
|
|||
<p>#confirmLink#</p>
|
||||
<p>Thanks,<br>The Payfrit Team</p>
|
||||
";
|
||||
</cfscript>
|
||||
|
||||
<cfmail to="#email#"
|
||||
from="admin@payfrit.com"
|
||||
subject="Welcome to Payfrit - Please confirm your email"
|
||||
type="html">
|
||||
<cfoutput>#emailBody#</cfoutput>
|
||||
</cfmail>
|
||||
emailSent = false;
|
||||
try {
|
||||
mailService = new mail();
|
||||
mailService.setTo(email);
|
||||
mailService.setFrom("admin@payfrit.com");
|
||||
mailService.setSubject("Welcome to Payfrit - Please confirm your email");
|
||||
mailService.setType("html");
|
||||
mailService.send(body=emailBody);
|
||||
emailSent = true;
|
||||
} catch (any mailErr) {
|
||||
// Mail failed but profile was saved - continue
|
||||
}
|
||||
|
||||
<cfscript>
|
||||
writeOutput(serializeJSON({
|
||||
"OK": true,
|
||||
"MESSAGE": "Profile updated. Please check your email to confirm your address."
|
||||
"MESSAGE": emailSent ? "Profile updated. Please check your email to confirm your address." : "Profile updated."
|
||||
}));
|
||||
|
||||
} catch (any e) {
|
||||
|
|
|
|||
Reference in a new issue