diff --git a/api/auth/completeProfile.cfm b/api/auth/completeProfile.cfm index a5ebfde..53221ad 100644 --- a/api/auth/completeProfile.cfm +++ b/api/auth/completeProfile.cfm @@ -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 = "

Welcome to Payfrit, #firstName#!

@@ -118,19 +118,23 @@ try {

#confirmLink#

Thanks,
The Payfrit Team

"; - - - #emailBody# - + 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 + } - 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) {