设计,用我的邮件包装发送指令 [英] Devise, send instructions with my mail wrapper

查看:223
本文介绍了设计,用我的邮件包装发送指令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有madmimi包装纸,有人写过它作为助手,而且无论如何我都必须使用它。所以我想知道如何使用自己的包装器发送带有重置链接的忘记密码的邮件。

I have madmimi wrapper that somebody wrote as a helper, andi i have to use it not matter what. So i was wondering how would i go about sending forgot password mail with reset link with my own wrapper.

我的方法如下:

MyApp::MadMimi.send! :forgot_password, @user, @link

我如何以某种方式覆盖send_reset_password_instructions,生成链接并将其发送像这样吗?

How i can somehow override send_reset_password_instructions, generate a link and send it like this?

谢谢大家。

推荐答案

我明白了,

我只是在管理模型中覆盖了send_reset_password_instructions:

I just overrided send_reset_password_instructions in admin model:

def send_reset_password_instructions
    token = set_reset_password_token # Use the token if i need it inside link

    MyApp::MadMimi.send! :forgot_password, current_user, link

    token
end

这篇关于设计,用我的邮件包装发送指令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆