-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1306d4f
commit a0352e8
Showing
5 changed files
with
28 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module UserHelper | ||
|
||
# factory methode | ||
def subscribe(user) | ||
if $SUBSCRIBE_SERVICE.upcase == "SYMPA" | ||
return SympaSubscribeMailer.with(user).register_for_announce_list.deliver_now; | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class SympaSubscribeMailer < ApplicationMailer | ||
|
||
def register_for_announce_list | ||
|
||
unless $SUBSCRIBE_LIST_NAME.nil? || $SUBSCRIBE_LIST_NAME.empty? | ||
@user = params[:user] | ||
@sub = "subscribe #{$SUBSCRIBE_LIST_NAME} #{@user.firstName} #{@user.lastName}" | ||
mail(to: $SUBSCRIBE_SERVICE_MAIL, from: @user.email, subject: @sub) | ||
end | ||
|
||
end | ||
|
||
end |
Empty file.