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" }
|
userId: { value: userId, cfsqltype: "cf_sql_integer" }
|
||||||
}, { datasource: "payfrit" });
|
}, { 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;
|
confirmLink = "https://biz.payfrit.com/confirm_email.cfm?UUID=" & qUser.UserUUID;
|
||||||
emailBody = "
|
emailBody = "
|
||||||
<p>Welcome to Payfrit, #firstName#!</p>
|
<p>Welcome to Payfrit, #firstName#!</p>
|
||||||
|
|
@ -118,19 +118,23 @@ try {
|
||||||
<p>#confirmLink#</p>
|
<p>#confirmLink#</p>
|
||||||
<p>Thanks,<br>The Payfrit Team</p>
|
<p>Thanks,<br>The Payfrit Team</p>
|
||||||
";
|
";
|
||||||
</cfscript>
|
|
||||||
|
|
||||||
<cfmail to="#email#"
|
emailSent = false;
|
||||||
from="admin@payfrit.com"
|
try {
|
||||||
subject="Welcome to Payfrit - Please confirm your email"
|
mailService = new mail();
|
||||||
type="html">
|
mailService.setTo(email);
|
||||||
<cfoutput>#emailBody#</cfoutput>
|
mailService.setFrom("admin@payfrit.com");
|
||||||
</cfmail>
|
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({
|
writeOutput(serializeJSON({
|
||||||
"OK": true,
|
"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) {
|
} catch (any e) {
|
||||||
|
|
|
||||||
Reference in a new issue