Skip to content

Commit 6a14470

Browse files
committed
Added mail_preview configuration and welcome_email preview
1 parent f40922b commit 6a14470

File tree

3 files changed

+124
-405
lines changed

3 files changed

+124
-405
lines changed

app/mailers/mail_preview.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class MailPreview < MailView
2+
def welcome_email
3+
user = User.find_or_create_by_username('testusername') do |u|
4+
u.email = 'test@example.com'
5+
u.location = 'Chicago, IL'
6+
end
7+
mail = Notifier.welcome_email(user.username)
8+
user.destroy
9+
mail
10+
end
11+
end

app/mailers/notifier.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def welcome_email(username)
3434
@user = User.with_username(username)
3535
@user.touch(:last_email_sent)
3636

37-
3837
if @user.created_at < 2.days.ago
3938
track_campaign('welcome_delayed')
4039
else

0 commit comments

Comments
 (0)