-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement voluntary contribution form and email
- Loading branch information
Marc Altmann
committed
Feb 8, 2016
1 parent
a49e48e
commit 022509d
Showing
15 changed files
with
166 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) 2012-2016, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
class RegistrationsMailer < ActionMailer::Base | ||
helper MailerHelper | ||
|
||
default from: EMAIL_ADDRESSES['default'] | ||
|
||
def voluntary_contribution_email(email, amount) | ||
@amount = amount | ||
mail(to: email, subject: 'Dein freiwilliger Grundbeitrag für Fairmondo') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
app/views/registrations_mailer/voluntary_contribution_email.text.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Liebe neue Nutzerin, lieber neuer Nutzer, | ||
|
||
vielen Dank für Deine Bereitschaft, die Weiterentwicklung von Fairmondo zu unterstützen! | ||
|
||
Bitte schließe den Prozess auf der Seite unseres Partners Fastbill ab: | ||
|
||
<%= voluntary_contribution_link(@amount) %> | ||
|
||
Dein freiwilliger Grundbeitrag wird stets zum ersten des Monats gebucht. Er ist jederzeit kündbar. | ||
|
||
Mit fairen Grüßen, | ||
|
||
Dein Fairmondo-Team | ||
|
||
-- | ||
|
||
Fairmondo eG | ||
Glogauer Str. 21 | ||
10999 Berlin | ||
|
||
www.fairmondo.de | ||
Gutes einfach entdecken | ||
|
||
Registergericht: Amtsgericht Berlin-Charlottenburg, GnR 738 B USt-IdNr.: DE 290376380 | ||
|
||
Vorstand: Felix Weth, Richard Schmid | ||
Aufsichtsratsvorsitzender: Kim Stattaus | ||
|
||
Facebook: www.facebook.com/fairmondo | ||
Beteiligung an der Genossenschaft: mitmachen.fairmondo.de/anteile-zeichnen/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
db/migrate/20160128144253_add_voluntary_contribution_to_user.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class AddVoluntaryContributionToUser < ActiveRecord::Migration | ||
def change | ||
add_column :users, :voluntary_contribution, :integer | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (c) 2012-2016, Fairmondo eG. This file is | ||
# licensed under the GNU Affero General Public License version 3 or later. | ||
# See the COPYRIGHT file for details. | ||
|
||
require_relative '../test_helper' | ||
|
||
describe RegistrationsMailer do | ||
include EmailSpec::Helpers | ||
include EmailSpec::Matchers | ||
|
||
let(:email) { 'mail@example.com' } | ||
|
||
it '#voluntary_contribution_email with amount of 3' do | ||
mail = RegistrationsMailer.voluntary_contribution_email(email, 3) | ||
mail.must deliver_to email | ||
mail.subject.must_equal('Dein freiwilliger Grundbeitrag für Fairmondo') | ||
mail.must have_body_text 'vielen Dank für Deine Bereitschaft, die Weiterentwicklung von '\ | ||
'Fairmondo zu unterstützen!' | ||
mail.must have_body_text 'https://automatic.fastbill.com/purchase/7f1d4c9a3c8e6ec21543fde6377132d6/25-1' | ||
end | ||
|
||
it '#voluntary_contribution_email with amount of 5' do | ||
mail = RegistrationsMailer.voluntary_contribution_email(email, 5) | ||
mail.must deliver_to email | ||
mail.must have_body_text 'https://automatic.fastbill.com/purchase/7f1d4c9a3c8e6ec21543fde6377132d6/25-2' | ||
end | ||
|
||
it '#voluntary_contribution_email with amount of 10' do | ||
mail = RegistrationsMailer.voluntary_contribution_email(email, 10) | ||
mail.must deliver_to email | ||
mail.must have_body_text 'https://automatic.fastbill.com/purchase/7f1d4c9a3c8e6ec21543fde6377132d6/25-3' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters