Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 8ae5ff2

Browse files
committed
Fix emails issue
1 parent 685b7b6 commit 8ae5ff2

4 files changed

Lines changed: 192 additions & 148 deletions

File tree

app/controllers/admin/AdminController.cfc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,9 @@ component extends="app.Controllers.Controller" {
443443
"buttonTitle" = "View Your Post",
444444
"content" = "Thank you for writing a blog post. Your post '#blog.title#' has been published on the Wheels website.",
445445
"URl" = siteurl,
446-
"Footer" = "If you did not write blog post, you can safely ignore this email."
446+
"Footer" = "If you did not write blog post, you can safely ignore this email.",
447+
"footerGreetings" = "Thank you for being a part of Wheels community.",
448+
"isSubscriber" = user.newsletter
447449
};
448450
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
449451
cfheader(name="Content-Type" value="text/html; charset=UTF-8");
@@ -799,7 +801,9 @@ component extends="app.Controllers.Controller" {
799801
"buttonTitle" = "View Your Comment",
800802
"content" = "Thanks for commenting on our blog post. Your comment is now live on the Wheels site.",
801803
"URl" = siteurl,
802-
"Footer" = "If you did not write comment, you can safely ignore this email."
804+
"Footer" = "If you did not write comment, you can safely ignore this email.",
805+
"footerGreetings" = "Thank you for being a part of Wheels community.",
806+
"isSubscriber" = user.newsletter
803807
};
804808
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
805809
cfmail(
@@ -873,7 +877,9 @@ component extends="app.Controllers.Controller" {
873877
"buttonTitle" = "View Your Post",
874878
"content" = "Thank you for writing a blog post. Your post '#blog.title#' has been rejected.",
875879
"URl" = "",
876-
"Footer" = "If you did not write blog post, you can safely ignore this email."
880+
"Footer" = "If you did not write blog post, you can safely ignore this email.",
881+
"footerGreetings" = "Thank you for being a part of Wheels community.",
882+
"isSubscriber" = user.newsletter
877883
};
878884
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
879885
cfheader(name="Content-Type" value="text/html; charset=UTF-8");

app/controllers/admin/testimonialController.cfc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ component extends="app.Controllers.Controller" {
222222
"buttonTitle" = "View Your Testimonial",
223223
"content" = "Thank you for writing a testimonial. Your testimonial has been approved and published on the Wheels website.",
224224
"URl" = siteurl,
225-
"Footer" = "If you did not write testinomial, you can safely ignore this email."
225+
"Footer" = "If you did not write testinomial, you can safely ignore this email.",
226+
"footerGreetings" = "Thank you for being a part of Wheels community.",
227+
"isSubscriber" = user.newsletter
226228
};
227229
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
228230
cfheader(name="Content-Type" value="text/html; charset=UTF-8");

app/controllers/web/AuthController.cfc

Lines changed: 68 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,12 @@ component extends="app.Controllers.Controller" {
528528
verifyUrl = verifyUrl & "?token=" & token;
529529
var emailparams = {
530530
"name" = user.fullname,
531+
"welcomeMessage" = "Welcome to Wheels.dev!",
531532
"buttonTitle" = "Verify Your Account",
532533
"content" = "Thank you for signing up. Please click the button below to verify your account and get started.",
533534
"URl" = verifyUrl,
534-
"Footer" = "If you did not request reset password, you can safely ignore this email."
535+
"Footer" = "If you did not request reset password, you can safely ignore this email.",
536+
"footerGreetings" = "Thank you for becoming a part of Wheels community."
535537
};
536538
emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
537539

@@ -540,7 +542,7 @@ component extends="app.Controllers.Controller" {
540542
cfmail(
541543
to = "#user.email#",
542544
from = "#application.env.mail_from#",
543-
subject = "Verify Your Email",
545+
subject = "Verify Your Account",
544546
server = "#application.env.smtp_host#",
545547
port = "#application.env.smtp_port#",
546548
username = "#application.env.smtp_username#",
@@ -655,9 +657,10 @@ component extends="app.Controllers.Controller" {
655657
"message" = "Password reset instructions have been sent to your email."
656658
};
657659
} else {
660+
sendSignUpEmail(params.email);
658661
data = {
659-
"success" = false,
660-
"message" = "No account found with that email address."
662+
"success" = true,
663+
"message" = "Password reset instructions have been sent to your email."
661664
};
662665
}
663666

@@ -803,7 +806,8 @@ component extends="app.Controllers.Controller" {
803806
"buttonTitle" = "Reset Password",
804807
"content" = "We received a request to reset the password for your account associated with this email address. If you made this request please click the button below to create a new password",
805808
"URl" = resetUrl,
806-
"Footer" = "If you did not request reset password, you can safely ignore this email."
809+
"Footer" = "If you did not request reset password, you can safely ignore this email.",
810+
"footerGreetings" = "Thank you for being a part of Wheels community."
807811
};
808812
var emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
809813
cfheader(name="Content-Type" value="text/html; charset=UTF-8");
@@ -842,4 +846,63 @@ component extends="app.Controllers.Controller" {
842846
throw e;
843847
}
844848
}
849+
850+
private void function sendSignUpEmail(required string email) {
851+
try {
852+
model("Log").log(
853+
category = "wheels.auth",
854+
level = "INFO",
855+
message = "Account not found sending signup reset email",
856+
details = {
857+
"email": email
858+
}
859+
);
860+
var signUpUrl = urlFor(action="register", onlyPath=false);
861+
var emailparams = {
862+
"name" = "User",
863+
"buttonTitle" = "Register here",
864+
"content" = "content" = "We noticed you tried to reset your password using this email address, but it looks like there's no account associated with it.
865+
No worries — it happens! If you're new to Wheels, we would love to have you on board.
866+
<br><br>Click below to create your free account and start building powerful ColdFusion applications with ease.",
867+
"URl" = signUpUrl,
868+
"Footer" = "If you believe this is a mistake or you already have an account with a different email, feel free to try again or contact our support team for help.<br><br>If you did not request reset password, you can safely ignore this email.",
869+
"footerGreetings" = ""
870+
};
871+
var emailContent = renderView(template="/email", layout=false, returnAs="string", params=emailparams);
872+
cfheader(name="Content-Type" value="text/html; charset=UTF-8");
873+
cfmail(
874+
to = "#arguments.email#",
875+
from = "#application.env.mail_from#",
876+
subject = "No Account Found : Get Started with Wheels Today!",
877+
server = "#application.env.smtp_host#",
878+
port = "#application.env.smtp_port#",
879+
username = "#application.env.smtp_username#",
880+
password = "#application.env.smtp_password#",
881+
type = "html"
882+
) {
883+
writeOutput(emailContent);
884+
};
885+
model("Log").log(
886+
category = "wheels.auth",
887+
level = "INFO",
888+
message = "Sign up email sent",
889+
details = {
890+
"email": email
891+
}
892+
);
893+
} catch (any e) {
894+
model("Log").log(
895+
category = "wheels.auth",
896+
level = "ERROR",
897+
message = "Error sending sign up email on account not found",
898+
details = {
899+
"email": email,
900+
"token": token,
901+
"error_message": e.message,
902+
"error_detail": e.detail
903+
}
904+
);
905+
throw e;
906+
}
907+
}
845908
}

0 commit comments

Comments
 (0)