mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
17
app/mailers/user_mailer.rb
Normal file
17
app/mailers/user_mailer.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
class UserMailer < ApplicationMailer
|
||||
# 注意:这个地方一定要和你的邮箱服务域名一致
|
||||
default from: 'educoder@trustie.org'
|
||||
|
||||
# 用户注册验证码
|
||||
def register_email(mail, code)
|
||||
@code = code
|
||||
mail(to: mail, subject: '验证你的电子邮件')
|
||||
end
|
||||
|
||||
# 课堂讨论区的邮件通知
|
||||
def course_message_email(mail, message_id)
|
||||
@message = Message.find_by(id: message_id)
|
||||
@course = @message&.board&.course
|
||||
mail(to: mail, subject: '课堂发布了新的帖子') if @message.present? && @course.present?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user