邮件程序不处理列更新
Mailer not working on column update
我目前每次通过我在 adminium 的管理平台为用户更改列余额时,我都会有一个邮件程序发送一封电子邮件。我可以通过 Adminium 更改列,它会很好地保存它并在数据库中更改它,但电子邮件不会发送。
User.rb
after_update :balance_has_changed?
def balance_has_changed?
if balance_changed?
# balance
# balance_was
# send an email!
UserMailer.balance_changed(self, balance, balance_was).deliver
end
end
handle_asynchronously :balance_has_changed?
UserMailer
def balance_changed(user, new_balance, old_balance)
mandrill_mail(
template: 'balance_changed',
subject: 'New Earnings through Bundel!',
to: { email:user.email },
vars: {
'OLD_BALANCE' => old_balance,
'NEW_BALANCE' => new_balance
}
)
end
将 Mandrill 与 Mailchimp 结合使用 - 模板已全部上传到 Mandrill,因此那边没有错误。
任何帮助都会很棒。
How similar / different is Adminium from gems such as rails_admin or active_admin ? It is similar in purpose to rails_admin and
active_admin.
It is however different in how it operates and thus allows different
things. Rails admin and active admin are gems to be used with a Rails
3 application whereas Adminium is an Heroku add-on which can be used
with any Heroku application, no matter the Rails version, the
framework or even the language.
It also differs in the way it is configured ; rails / active admin use
DSLs and thus require to write code and deploy the application to
modify the configuration of the admin, whereas all the configuration
in Adminium is done via the interface independently of the lifecycle
of the target application and also allowing non technical users to be
in charge of it
这不会与您的 rails 应用集成,也不会触发 rails 回调。
这是它正在做的事情:
管理 -> 数据库
不是这个:
Adminium -> Rails -> 数据库
您可以编写一个 rails rake 任务来检查列是否已更改并发送电子邮件。您可能需要缓存列或其他内容。
我目前每次通过我在 adminium 的管理平台为用户更改列余额时,我都会有一个邮件程序发送一封电子邮件。我可以通过 Adminium 更改列,它会很好地保存它并在数据库中更改它,但电子邮件不会发送。
User.rb
after_update :balance_has_changed?
def balance_has_changed?
if balance_changed?
# balance
# balance_was
# send an email!
UserMailer.balance_changed(self, balance, balance_was).deliver
end
end
handle_asynchronously :balance_has_changed?
UserMailer
def balance_changed(user, new_balance, old_balance)
mandrill_mail(
template: 'balance_changed',
subject: 'New Earnings through Bundel!',
to: { email:user.email },
vars: {
'OLD_BALANCE' => old_balance,
'NEW_BALANCE' => new_balance
}
)
end
将 Mandrill 与 Mailchimp 结合使用 - 模板已全部上传到 Mandrill,因此那边没有错误。
任何帮助都会很棒。
How similar / different is Adminium from gems such as rails_admin or active_admin ? It is similar in purpose to rails_admin and active_admin.
It is however different in how it operates and thus allows different things. Rails admin and active admin are gems to be used with a Rails 3 application whereas Adminium is an Heroku add-on which can be used with any Heroku application, no matter the Rails version, the framework or even the language.
It also differs in the way it is configured ; rails / active admin use DSLs and thus require to write code and deploy the application to modify the configuration of the admin, whereas all the configuration in Adminium is done via the interface independently of the lifecycle of the target application and also allowing non technical users to be in charge of it
这不会与您的 rails 应用集成,也不会触发 rails 回调。
这是它正在做的事情: 管理 -> 数据库
不是这个: Adminium -> Rails -> 数据库
您可以编写一个 rails rake 任务来检查列是否已更改并发送电子邮件。您可能需要缓存列或其他内容。