adding invite email

This commit is contained in:
Maxwell Salzberg 2011-08-05 18:32:25 -07:00
parent a3104741c5
commit b4d4499299
6 changed files with 126 additions and 18 deletions

View file

@ -80,6 +80,12 @@ class InvitationsController < Devise::InvitationsController
redirect_to :back
end
def email
@invs = []
@resource = User.find_by_invitation_token(params[:invitation_token]) || User.first
@resource.invitation_token = 'foobar'
render 'devise/mailer/invitation_instructions', :layout => false
end
protected
def check_token

View file

@ -3,6 +3,7 @@
# the COPYRIGHT file.
module ApplicationHelper
def how_long_ago(obj)
timeago(obj.created_at)
end

View file

@ -0,0 +1,100 @@
<p style="background-color: rgb(255, 255, 255); text-align: center; font-size: 11px;">Email not displaying correctly? <a href="<%=invite_email_path(:invitation_token => @resource.invitation_token) %>" style="color: #3F8FBA; text-decoration: none;">View it</a> in your browser</p>
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tbody><tr><td style="padding: 30px 15px 0pt; background-color: rgb(221, 221, 221);">
<table style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 16px; color: rgb(51, 51, 51);" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td style="background-color: rgb(0, 0, 0);">
<a style="display: block;" href="<%= accept_invitation_url(@resource, :invitation_token => @resource.invitation_token) %>" target="_blank">
<img alt="Diaspora" src="http://dl.dropbox.com/u/15865/diaspora%20logo.png" style="border: 0pt none ; display: block;" height="134" width="600">
</a>
</td>
</tr>
<tr>
<td style="padding: 10px 0pt 0px 20px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 44px; font-weight: bold; color: rgb(0, 0, 0);">
Finally - it's here.<br></td>
</tr>
<tr><td style="padding: 0px 20px 0pt; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" width="600" height='389'>
<a href="<%= accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)%>" target="_blank"><img src="http://dl.dropbox.com/u/15865/diaspora_shots.jpg" style="border: 0pt none ; display: block;" width="560">
</a></td></tr>
<tr><td style="padding: 0pt 30px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; line-height: 20px;">
Diaspora is now in <strong>beta</strong>!
<br>
<a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="<%= accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)%>" target="_blank">Sign up now &rarr;</a>
</td></tr>
<tr><td style="padding: 20px 20px 0px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 44px; font-weight: bold; color: rgb(0, 0, 0);">
Get Connected</td></tr>
<tr><td>
<table style="padding: 0pt 20px; background: rgb(255, 255, 255) none repeat scroll 0%; font-size: 16px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td width="200">
<a href="<%=accept_invitation_url(@resource, :invitation_token => @resource.invitation_token) %>" target="_blank"><img style="border: 0pt none ; padding: 0pt 5px; display: block;" src="https://joindiaspora.s3.amazonaws.com/uploads/images/scaled_full_c7506ec0b3ae6694c64d.gif" height="156" width="200"></a>
</td>
<td style="line-height: 20px; width: 360px;">
An international movement with a shared vision for a better web, Diaspora's #1 feature is its community. Meet new people, connect with friends, and join the fun.
<br>
<!-- <a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="https://joindiaspora.com/channels" target="_blank">Tune in to your favorite Channels</a>-->
</td>
</tr>
</tbody></table>
</td></tr>
<tr><td style="padding: 20px 20px 0px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 44px; font-weight: bold; color: rgb(0, 0, 0);">
Be Yourself</td></tr>
<tr><td>
<table style="padding: 0pt 20px; background: rgb(255, 255, 255) none repeat scroll 0%; font-size: 16px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td style="line-height: 20px; width: 360px;">
Expression is what makes the internet awesome. Because Diaspora is controlled by its users, you are free to express your identity and share in any way you want!
<br>
<!-- <a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="#" target="_blank">Watch all the bumpers</a>-->
</td>
<td width="200">
<a href="<%= accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)%>" target="_blank"><img style="border: 0pt none ; padding: 0pt 5px; display: block;" src="http://dl.dropbox.com/u/15865/apolonisaphrodisia.png" height="150" width="170"></a>
</td>
</tr>
</tbody></table>
</td></tr>
<tr><td style="padding: 20px 20px 0px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-size: 44px; font-weight: bold; color: rgb(0, 0, 0);">
Collect the Web</td></tr>
<tr><td>
<table style="padding: 0pt 20px; background: rgb(255, 255, 255) none repeat scroll 0%; font-size: 16px; color: rgb(51, 51, 51); -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;" align="center" border="0" cellpadding="0" cellspacing="0" width="600">
<tbody><tr>
<td width="200">
<a href="<%= accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)%>" target="_blank"><img style="border: 0pt none ; padding: 0pt 5px; display: block;" src="http://joindiaspora.com/images/cubbies_screenshot2.png" height="151" width="200"></a>
</td>
<td style="line-height: 20px; width: 360px;">
Be they funny or inspirational, the internet is full of wonderful images.
Cubbi.es, world's first Diaspora application, gives you a beautiful way to keep track and share your best finds with people you care about. <br>
<!-- <a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="#" target="_blank">Watch all the bumpers</a>-->
</td>
</tr>
</tbody></table>
</td></tr>
<tr><td style="padding: 40px 20px 20px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
<a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="<%=accept_invitation_url(@resource, :invitation_token => @resource.invitation_token)%>" target="_blank">Click Here to Accept your invite!</a>
</tr></td>
<tr><td style="padding: 40px 20px 20px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
Diaspora is open source software, and there has never been a better time to <a style="color: #3F8FBA; text-decoration: underline; font-weight: bold; font-size: 20px;" href="https://github.com/diaspora/diaspora" target="_blank">jump in</a> than now!
</tr></td>
<tr><td style="padding: 40px 20px 20px; background: rgb(255, 255, 255) none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">
Love,<br>
Team Diaspora<br>
</td></tr>
<tr><td style="padding: 35px 40px; font-size: 11px; color: rgb(102, 102, 102); line-height: 16px;">
To unsubscribe please click <a style="color: #3F8FBA; text-decoration: none;" href="http://joindiaspora.us1.list-manage.com/unsubscribe?u=d759919b94f9cdcf39d204f3f&id=7b5ceb2f8b">here</a>.
For general inquiries or support with your Diaspora account, please email us at <a style="color: #3F8FBA; text-decoration: none;" href="mailto:questions@joindiaspora.com">questions@joindiaspora.com</a>.
</td></tr>
</tbody></table></td></tr></tbody></table>

View file

@ -1,22 +1,22 @@
-if @invs.count > 0
!!!
%html
%head
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
= render :partial => 'notifier/notifier_css'
%body
%header
= image_tag AppConfig[:pod_url] + 'images/logo_caps.png'
#container
- @invs = @resource.invitations_to_me
%p
= t('devise.mailer.welcome', :email => @resource.email)
= render :partial => 'inviters'
%html
%head
%meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
= render :partial => 'notifier/notifier_css'
%body
%header
= image_tag AppConfig[:pod_url] + 'images/logo_caps.png'
#container
- @invs = @resource.invitations_to_me
%p
= t('devise.mailer.welcome', :email => @resource.email)
= render :partial => 'inviters'
%p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text"
%p.small
= t('.ignore')
%br/
= t('.no_account_till')
%p= link_to t('.accept'), accept_invitation_url(@resource, :invitation_token => @resource.invitation_token), :class => "large_text"
%p.small
= t('.ignore')
%br/
= t('.no_account_till')
-else
= render :partial => 'batch_invites'
= render :partial => 'devise/mailer/batch_invites'

View file

@ -82,6 +82,7 @@ Diaspora::Application.routes.draw do
:sessions => "sessions",
:invitations => "invitations"} do
get 'invitations/resend/:id' => 'invitations#resend', :as => 'invitation_resend'
get 'invitations/invite' => 'invitations#email', :as => 'invite_email'
end
get 'login' => redirect('/users/sign_in')