简体   繁体   English

rails 2 actionmailer电子邮件地址别名

[英]rails 2 actionmailer email address alias

I am working with rails 2 . 我正在使用rails 2。 I wanted to know is there a way in ActionMailer to hide/alias the email address?? 我想知道ActionMailer中是否可以隐藏/别名电子邮件地址? Also what should be the best approach for sending bulk emails??? 另外,发送批量电子邮件的最佳方法应该是什么??? Thanks in advance. 提前致谢。

Mailcar 邮车

Mailcar 0.1 邮车0.1

Mailcar is a dead-simple (ie. not many features) bulk emailer for Ruby on Rails, using ActiveRecord and ActionMailer. Mailcar是使用ActiveRecord和ActionMailer的Ruby on Rails的简陋(即功能不多)批量电子邮件发送程序。

If you need to send emails to your entire user base and don't want to pay the high prices that most mass email services charge, then this is the plugin for you! 如果您需要向整个用户群发送电子邮件,并且不想支付大多数电子邮件服务所收取的高昂价格,那么这是给您的插件!

WARNING!!! 警告!!! Using this without having your SMTP server set up correctly could land your server on hundreds of blacklists. 在没有正确设置SMTP服务器的情况下使用此功能可能会使您的服务器进入数百个黑名单。 If that prospects scares you, look at the pay-to-send bulk emailers. 如果那样的前景吓到了您,请查看付费发送批量电子邮件收发器。 It's expensive, but at least you know you're safe. 它很昂贵,但至少您知道自己很安全。

WARNING!!! 警告!!! As is, this script is tied tightly to the codebase I wrote it for. 照原样,此脚本与我为其编写的代码库紧密相关。 It will not work out of the box. 开箱即用。 I'm posting it in the hopes that someone else needs something similar and doesn't want to start from scratch. 我将其发布是希望其他人也需要类似的东西,并且不想从头开始。 Please send me patches or pull requests with your upgrades and I'll include them and add you to the credits. 请向我发送补丁或请求升级,我将包括它们并将您添加到积分中。

Installation 安装

To copy the models and create the migration, run: 要复制模型并创建迁移,请运行:

script/generate mailcar all 脚本/生成mailcar全部

Then execute the migration: 然后执行迁移:

rake db:migrate 耙db:migrate

Example

To send a new bulk email, you must first create the message body file. 要发送新的批量电子邮件,必须首先创建消息正文文件。 I use Thunderbird to create an HTML email, then save it out as HTML. 我使用Thunderbird创建HTML电子邮件,然后将其另存为HTML。

At that point, you can create the message and send it as follows: 此时,您可以创建消息并按以下方式发送:

rake mailcar:new_message FROM='me@mydomain.com' SUBJECT='New features on the site' BODY_FILE=/path/to/email/body rake mailcar:new_message FROM='me@mydomain.com'SUBJECT ='网站上的新功能'BODY_FILE = / path / to / email / body

rake mailcar:prep_for_send MESSAGE_ID=99 耙mailcar:prep_for_send MESSAGE_ID = 99

rake mailcar:send MESSAGE_ID=99 耙mailcar:发送MESSAGE_ID = 99

If the sending process is ever interrupted, you can resume it with another call to send. 如果发送过程曾经中断,您可以通过另一个发送呼叫来恢复发送过程​​。

TODO 去做

  • Add a test suite (wish I knew more about plugin testing...) 添加一个测试套件(希望我对插件测试有更多了解...)
  • Make it easy to give a block (or something) to generate the list of email addresses 轻松给出一个阻止(或其他内容)以生成电子邮件地址列表
  • Pass emails through ERB to allow for templating / dynamic emails 通过ERB传递电子邮件以允许模板/动态电子邮件
  • Add support for multipart emails 添加对多部分电子邮件的支持
  • Add a cleanup task to remove old messages 添加清理任务以删除旧消息
  • Make sending delay configurable 使发送延迟可配置

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

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