简体   繁体   English

Rails在用户之间发送电子邮件

[英]Rails sending emails between users

I'm working on an app where I want the users to be able to send messages between each other via email. 我正在开发一个应用程序,希望用户能够通过电子邮件在彼此之间发送消息。 I checked Action Mailer but it allows me to send emails from my application not between two users. 我检查了Action Mailer,但它允许我从应用程序发送电子邮件,而不是在两个用户之间发送。

I was thinking of doing it by displaying the user email so they can click on it and send that user email. 我当时想通过显示用户电子邮件来做到这一点,以便他们可以单击并发送该用户电子邮件。 Any idea about how i should do this? 关于我应该怎么做的任何想法?

If you're satisfied with only email-link, then you can just use mailto url-helper. 如果您仅对电子邮件链接感到满意,则可以使用mailto url-helper。 It'll open your local default email-client. 它将打开您的本地默认电子邮件客户端。

For ex. 对于前。

mail_to "where.to.send@mail.com", "Link name", cc: "send.here.as.cc@mail.com", subject: "Yep, it works"

will produce 将产生

<a href="mailto:where.to.send@mail.com?cc=send.here.as.cc%40mail.com&amp;subject=Yep%2C%20it%20works">Link name</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM