-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix category from organizations. Check all emails.
- Loading branch information
Showing
15 changed files
with
64 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class ApplicationMailer < ActionMailer::Base | ||
default from: "from@example.com" | ||
default from: "no-reply@madrid.es" | ||
layout 'mailer' | ||
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 |
---|---|---|
@@ -1,59 +1,53 @@ | ||
class EventMailer < ApplicationMailer | ||
|
||
def decline(event) | ||
return unless event.lobby_contact_email | ||
@lobby_name = event.lobby_user_name | ||
@lobby_name = event.lobby_user_name.present? ? event.lobby_user_name : event.organization.user.first_name | ||
@reasons = event.declined_reasons | ||
@event_title = event.title | ||
@name = event.user.full_name | ||
@declined_at = l event.declined_at, format: :short | ||
to = event.lobby_contact_email.present? ? event.lobby_contact_email : event.organization.user.email | ||
subject = t('mailers.decline_event.subject', title: @event_title) | ||
mail(to: event.lobby_contact_email, subject: subject) | ||
mail(to: to, bcc: "registrodelobbies@madrid.es", subject: subject) | ||
end | ||
|
||
def accept(event) | ||
return unless event.lobby_contact_email | ||
@lobby_name = event.lobby_user_name | ||
@lobby_name = event.lobby_user_name.present? ? event.lobby_user_name : event.organization.user.first_name | ||
@event_title = event.title | ||
@name = event.user.full_name | ||
@accepted_at = l event.accepted_at, format: :short | ||
to = event.lobby_contact_email.present? ? event.lobby_contact_email : event.organization.user.email | ||
subject = t('mailers.accept_event.subject', title: @event_title) | ||
mail(to: event.lobby_contact_email, subject: subject) | ||
mail(to: to, bcc: "registrodelobbies@madrid.es", subject: subject) | ||
end | ||
|
||
def cancel(event, user) | ||
if user.lobby? | ||
to = user.email | ||
return unless user.email | ||
name = event.lobby_user_name | ||
else | ||
return unless event.lobby_contact_email | ||
to = event.lobby_contact_email | ||
name = event.user.name | ||
end | ||
def cancel(event) | ||
#pending titular email | ||
#pending canceled author | ||
manages_emails = event.position.holder.users.collect(&:email).join(",") | ||
lobby_email = event.lobby_contact_email.present? ? event.lobby_contact_email : event.organization.user.email | ||
to = lobby_email + ", " + manages_emails | ||
@reasons = event.canceled_reasons | ||
@canceled_at = l event.canceled_at, format: :short | ||
@event_title = event.title | ||
@name = name | ||
subject = t('mailers.cancel_event.subject', title: @event_title) | ||
mail(to: to, subject: subject) | ||
mail(to: to, bcc: "registrodelobbies@madrid.es", subject: subject) | ||
end | ||
|
||
def create(event, user) | ||
if user.lobby? | ||
to = user.email | ||
return unless user.email | ||
name = event.lobby_user_name | ||
def create(event) | ||
if event.status == "requested" | ||
manages_emails = event.position.holder.users.collect(&:email).join(",") | ||
#pending titular email | ||
to = manages_emails | ||
name = event.lobby_user_name.present? ? event.lobby_user_name : event.organization.user.first_name | ||
else | ||
return unless event.lobby_contact_email | ||
to = event.lobby_contact_email | ||
to = event.lobby_contact_email.present? ? event.lobby_contact_email : event.organization.user.email | ||
name = event.user.name | ||
end | ||
@lobby_name = event.lobby_user_name | ||
@event_title = event.title | ||
@name = name | ||
subject = t('mailers.create_event.subject', title: @event_title) | ||
mail(to: to, subject: subject) | ||
mail(to: to, bcc: "registrodelobbies@madrid.es", subject: subject) | ||
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
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
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