doc/index.html in mail_engine-0.1.6 vs doc/index.html in mail_engine-0.1.7
- old
+ new
@@ -95,16 +95,77 @@
<pre class="code"><span class='rake identifier id'>rake</span> <span class='db identifier id'>db</span><span class='symbol val'>:migrate</span>
</pre>
<p><strong> Step 4: </strong></p>
+<p>Add acts<em>as</em>mail_receiver definition to "Your User" model.</p>
+
+<pre class="code"><span class='class class kw'>class</span> <span class='User constant id'>User</span> <span class='lt op'><</span> <span class='AR constant id'>AR</span>
+ <span class='acts_as_mail_receiver identifier id'>acts_as_mail_receiver</span> <span class='symbol val'>:payload_columns</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='dstring node'>%w{firstname lastname}</span><span class='comma token'>,</span>
+ <span class='symbol val'>:groups</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='dstring node'>%w{all english_users chinese_users}</span>
+<span class='end end kw'>end</span>
+</pre>
+
+<ol>
+<li> User model must have 'email' and payload specified columns, or else you can delegate to other model.</li>
+<li> "acts<em>as</em>mail_receiver" statement has to place below the scope statements.</li>
+</ol>
+
+
+<p><strong> Step 5: </strong></p>
+
+<p>Add sendgrid smtp api configure:</p>
+
+<pre class="code"><span class='class class kw'>class</span> <span class='UserMailer constant id'>UserMailer</span> <span class='lt op'><</span> <span class='ActionMailer constant id'>ActionMailer</span><span class='colon2 op'>::</span><span class='Base constant id'>Base</span>
+ <span class='sendgrid_header identifier id'>sendgrid_header</span> <span class='do do kw'>do</span>
+ <span class='category identifier id'>category</span> <span class='string val'>"xxx"</span>
+
+ <span class='filters identifier id'>filters</span> <span class='lbrace token'>{</span>
+ <span class='opentrack identifier id'>opentrack</span> <span class='string val'>"enable"</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>1</span>
+ <span class='clicktrack identifier id'>clicktrack</span> <span class='string val'>"enable"</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>1</span>
+ <span class='subscriptiontrack identifier id'>subscriptiontrack</span> <span class='string val'>"enable"</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>0</span>
+ <span class='template identifier id'>template</span> <span class='string val'>"enable"</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>0</span>
+ <span class='footer identifier id'>footer</span> <span class='string val'>"enable"</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='integer val'>0</span>
+ <span class='rbrace token'>}</span>
+ <span class='end end kw'>end</span>
+<span class='end end kw'>end</span>
+</pre>
+
+<p>For the detail information please check sendgrid.com.</p>
+
+<p><strong> Step 6: </strong></p>
+
+<p>Add below line to production.rb or development.rb for specifing the host.
+it will used when generate resource url when upload zip file.</p>
+
+<pre class="code"><span class='config identifier id'>config</span><span class='dot token'>.</span><span class='action_mailer identifier id'>action_mailer</span><span class='dot token'>.</span><span class='default_url_options identifier id'>default_url_options</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span> <span class='symbol val'>:host</span> <span class='assign token'>=</span><span class='gt op'>></span> <span class='string val'>"lvh.me:3000"</span> <span class='rbrace token'>}</span>
+</pre>
+
+<p><strong> Step 7: </strong></p>
+
<p>Add below line to the crontab list of your sever:</p>
<pre class="code"><span class='comment val'>### check mail schedule for every 15 minutes ###</span>
<span class='mult op'>*</span><span class='regexp val'>/4 * * * * sh -c "cd /</span><span class='path identifier id'>path</span><span class='div op'>/</span><span class='to identifier id'>to</span><span class='div op'>/</span><span class='your identifier id'>your</span><span class='div op'>/</span><span class='system identifier id'>system</span> <span class='andop op'>&&</span> <span class='rake identifier id'>rake</span> <span class='mail_engine identifier id'>mail_engine</span><span class='symbol val'>:sendmail</span> <span class='RAILS_ENV constant id'>RAILS_ENV</span><span class='assign token'>=</span><span class='production identifier id'>production</span><span class='string val'>"
</span></pre>
+<h1>Configuration</h1>
+
+<p>Below is the config for development env.</p>
+
+<pre class="code"><span class='development identifier id'>development</span><span class='colon op'>:</span>
+ <span class='log_mail identifier id'>log_mail</span><span class='colon op'>:</span> <span class='false false kw'>false</span> <span class='comment val'># if you want to enable the mail log, set true.</span>
+ <span class='user_class_name identifier id'>user_class_name</span><span class='colon op'>:</span> <span class='string val'>"User"</span> <span class='comment val'># Specify the User model in your system, which will used for mail schedule feature to find user groups and payloads.</span>
+ <span class='mount_at identifier id'>mount_at</span><span class='colon op'>:</span> <span class='string val'>"/admin/mail_engine"</span> <span class='comment val'># set the url path for mail engine.</span>
+ <span class='access_check_method identifier id'>access_check_method</span><span class='colon op'>:</span> <span class='string val'>"logged_in?"</span> <span class='comment val'># set a method name which will execute before each page action in mail engine.</span>
+ <span class='replacement_email identifier id'>replacement_email</span><span class='colon op'>:</span> <span class='string val'>"dev@youdomain.com"</span> <span class='comment val'># if you want to send all mail to one email, like on staging server or development environment, you can set this, or else don't set it.</span>
+ <span class='sendgrid identifier id'>sendgrid</span><span class='colon op'>:</span> <span class='comment val'># Below you need to set the sendgrid account info.</span>
+ <span class='sendgrid_user identifier id'>sendgrid_user</span><span class='colon op'>:</span> <span class='string val'>"you send grid username"</span> <span class='comment val'># </span>
+ <span class='sendgrid_key identifier id'>sendgrid_key</span><span class='colon op'>:</span> <span class='string val'>"password"</span> <span class='comment val'># </span>
+ <span class='sendgrid_category identifier id'>sendgrid_category</span><span class='colon op'>:</span> <span class='string val'>"my sendgrid category"</span> <span class='comment val'># </span>
+</pre>
+
<h1>Usage</h1>
<p><strong> For System Mail: </strong></p>
<p>Due to the sender of system mail is ActionMailer, so you just need to set template physical store path (e.g. user_mailer/notify)
@@ -141,10 +202,17 @@
<h1>Notes</h1>
<p>Currently only support above rails3.</p>
+<h1>Tips</h1>
+
+<p>Use below rake task, you can export local mail engine data, then import to production environment.</p>
+
+<pre class="code"><span class='rake identifier id'>rake</span> <span class='mail_engine identifier id'>mail_engine</span><span class='symbol val'>:export_mail_engine_database</span>
+</pre>
+
<h1>Screenshots</h1>
<h2>Dashboard</h2>
<p>Shows the latest report.</p>
@@ -201,11 +269,11 @@
<li>Total send count.</li>
<li>Already send count.</li>
<li>Sending Period.</li>
<li>Payloads which load from user model and send to template when sending.</li>
<li>First send date time, this date will indicate when this mail will be send first time, and according to the seding period it will resend at the same time after one period.</li>
-<li>You can set requirements, which been predefined in the system, let the mail not been sent if the requirements is unreached.</li>
+<li>You can control if run the schedule or not.</li>
</ol>
<p><img src="https://github.com/hlxwell/mail-engine/raw/master/screenshots/schedule.png" title="Mail Schedule" alt="Mail Schedule" /></p>
@@ -224,10 +292,10 @@
<h2>Bounce Report</h2>
<p><img src="https://github.com/hlxwell/mail-engine/raw/master/screenshots/bounce_report.png" title="Bounce Report" alt="Bounce Report" /></p></div></div>
<div id="footer">
- Generated on Fri Mar 4 17:56:24 2011 by
+ Generated on Mon Mar 14 22:31:43 2011 by
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
0.6.4 (ruby-1.8.7).
</div>
</body>
\ No newline at end of file