Skip to content

Commit

Permalink
Better FROM, remove mailchimp
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Dec 14, 2024
1 parent b86269b commit f27b4b9
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 36 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ jobs:
DEVISE_SECRET_KEY: test
GUMROAD_PRODUCT_ID: test
GUMROAD_SELLER_ID: test
MAILCHIMP_API_KEY: test
MAILCHIMP_LIST_ID: test
MAIN_DOMAIN: test
PAYPAL_SELLER_ID: test
SMTP_DOMAIN: test
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "devise"
gem 'devise-security'
gem "devise-otp"
gem "turnstile-captcha", require: "turnstile"
gem 'gibbon' # mailchimp connector

gem 'addressable' # better URI checking
# gem 'sinatra', '~> 2.0', '>= 2.0.8.1'
Expand Down
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ This app utilizes the following 3rd party services:
* [CloudFlare](http://cloudflare.com) managed DNS + free SSL support (free for basic service)
* [Mailgun](http://www.mailgun.com/rackspace) for Sending & Receiving Email (free for 50k emails per month)
* [Amazon S3](http://aws.amazon.com) for Photo Uploads & Storage (free for 1 year)
* [MailChimp](http://mailchimp.com) for sending updates to all users (free for 2,000 subscribers)
* [Google Analytics](http://google.com/analytics) for traffic stats (free for standard analytics)
* [Turnstile](https://www.cloudflare.com/products/turnstile/) to prevent bot signups (free).
* [Sentry](https://www.sentry.io/) to report errors (free)
Expand All @@ -29,8 +28,6 @@ SECRET_KEY_BASE: 1234..1234
DEVISE_SECRET_KEY: 1234..1234
SMTP_DOMAIN: post.yourdomain.com
MAILGUN_API_KEY=api-key
MAILCHIMP_API_KEY: f....3333-ek3
MAILCHIMP_LIST_ID: 9982...112
TURNSTILE_SITE_KEY: 6Lc6BAAAAAAAAChqRbQZcn_yyyyyyyyyyyyyyyyy
TURNSTILE_SECRET_KEY: 6Lc6BAAAAAAAAKN3DRm6VA_xxxxxxxxxxxxxxxxx
CLARIFAI_PERSONAL_ACCESS_TOKEN: asdl2k34jl2kn1l2hn234
Expand All @@ -46,9 +43,7 @@ STRIPE_SIGNING_SECRET: whsec_1234
### Things you may want to rip out
If you want to bypass using Mailchimp to collect email addresses, simply don't put a value in for `MAILCHIMP_API_KEY`. I use Mailchimp to email out new features to the users at Dabble.me, so if you're the only one using your app it doesn't make sense to have Mailchimp.

Same for Turnstile and Clarafai: simply don't add an environment variables for `TURNSTILE_SITE_KEY`, `CLARIFAI_V2_API_KEY`.
You can opt to not use Turnstile and Clarafai: simply don't add an environment variables for `TURNSTILE_SITE_KEY`, `CLARIFAI_V2_API_KEY`.


### Tests
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/import_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def perform(user_id,tmp_original_filename)
messages << error
end

ActionMailer::Base.mail(from: "Dabble Me Team <hello@#{ENV['MAIN_DOMAIN']}>",
ActionMailer::Base.mail(from: "Paul from Dabble Me <hello@#{ENV['MAIN_DOMAIN']}>",
to: user.email,
subject: "OhLife Image Import is complete",
body: messages.join("\n\n")).deliver
Expand Down
18 changes: 0 additions & 18 deletions app/jobs/user_job.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class UserMailer < ActionMailer::Base
helper EntriesHelper
helper :application

default from: "Dabble Me Team <hello@#{ENV['MAIN_DOMAIN']}>"
default from: "Paul from Dabble Me <hello@#{ENV['MAIN_DOMAIN']}>"

def welcome_email(user)
@user = user
Expand Down
6 changes: 0 additions & 6 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class User < ActiveRecord::Base
before_save { send_timezone.gsub!("&amp;", "&") }
after_commit on: :update do
restrict_free_frequency
subscribe_to_mailchimp
end
after_commit :send_welcome_email, on: :create

Expand Down Expand Up @@ -252,11 +251,6 @@ def restrict_free_frequency
end
end

def subscribe_to_mailchimp
email_lookup = self.previous_changes["email"]&.last(2)&.first&.downcase
UserJob.perform_later(email_lookup, self.id)
end

def send_welcome_email
UserMailer.welcome_email(self).deliver_later
rescue StandardError => e
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
config.mailer_sender = "Dabble Me Team <hello@#{ENV['MAIN_DOMAIN']}>"
config.mailer_sender = "Paul from Dabble Me <hello@#{ENV['MAIN_DOMAIN']}>"

# Configure the class responsible to send e-mails.
# config.mailer = 'Devise::Mailer'
Expand Down

0 comments on commit f27b4b9

Please sign in to comment.