Les mails envoyés n'ont plus de html, et sont wrappés à la colonne 80

This commit is contained in:
echarp 2014-08-16 17:39:24 +02:00
parent 0e73eb6c41
commit 2f23fd6914
7 changed files with 25 additions and 10 deletions

View File

@ -23,4 +23,8 @@ module EventsHelper
+ "#{@event.related_city.try :longitude}" + "#{@event.related_city.try :longitude}"
} }
end end
def wrap(s, width = 78)
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
end
end end

View File

@ -1,5 +1,7 @@
# Sending mails related to events life cycle # Sending mails related to events life cycle
class EventMailer < ActionMailer::Base class EventMailer < ActionMailer::Base
helper :events
def create(event) def create(event)
@event = event @event = event

View File

@ -1,5 +1,7 @@
# Sending mails related to events' moderation # Sending mails related to events' moderation
class ModerationMailer < ActionMailer::Base class ModerationMailer < ActionMailer::Base
helper :events
def create(event) def create(event)
@event = event @event = event

View File

@ -1,5 +1,7 @@
# Sending mails related to events' notes # Sending mails related to events' notes
class NoteMailer < ActionMailer::Base class NoteMailer < ActionMailer::Base
helper :events
def notify(note) def notify(note)
@note = note @note = note

View File

@ -1,12 +1,13 @@
===================================================== =====================================================
#{Event.human_attribute_name :title}: #{@event.title} #{Event.human_attribute_name(:title).concat(':').ljust 12 } #{@event.title}
#{Event.human_attribute_name :start_time}: #{l @event.start_time, format: :at} #{Event.human_attribute_name(:start_time).concat(':').ljust 12 } #{l @event.start_time, format: :at}
#{Event.human_attribute_name :end_time}: #{l @event.end_time, format: :at} #{Event.human_attribute_name(:end_time).concat(':').ljust 12 } #{l @event.end_time, format: :at}
#{Event.human_attribute_name :region}: #{@event.related_region} #{Event.human_attribute_name(:region).concat(':').ljust 12 } #{@event.related_region}
#{Event.human_attribute_name :city}: #{@event.city} #{Event.human_attribute_name(:city).concat(':').ljust 12 } #{@event.city}
#{Event.human_attribute_name :url}: #{@event.url} #{Event.human_attribute_name(:url).concat(':').ljust 12 } #{@event.url}
#{Event.human_attribute_name :contact}: #{@event.contact} #{Event.human_attribute_name(:contact).concat(':').ljust 12 } #{@event.contact}
#{Event.human_attribute_name :submitter}: #{@event.submitter} #{Event.human_attribute_name(:submitter).concat(':').ljust 12 } #{@event.submitter}
#{Event.human_attribute_name :tags}: #{@event.tags} #{Event.human_attribute_name(:tags).concat(':').ljust 12 } #{@event.tags}
#{Event.human_attribute_name :description}: #{raw @event.description} #{Event.human_attribute_name(:description).concat(':').ljust 12}
= wrap(strip_tags(@event.description)).gsub(/$/, ' ').gsub /^/, ' '
===================================================== =====================================================

View File

@ -4,4 +4,7 @@
\ \
= render file: '/events/show' = render file: '/events/show'
\ \
=t '.access'
= event_url @event
\
=t '.signature' =t '.signature'

View File

@ -353,6 +353,7 @@ pouvez éditer votre événement à l'adresse:"
subject: "[Agenda du Libre] Événement '%{subject}' modéré" subject: "[Agenda du Libre] Événement '%{subject}' modéré"
title: Bonjour, title: Bonjour,
body: L'événement a été modéré par %{author}. body: L'événement a été modéré par %{author}.
access: "Vous pouvez le consulter ici:"
signature: "-- \nL'équipe de modération" signature: "-- \nL'équipe de modération"
destroy: destroy:
subject: "[Agenda du Libre] Événement '%{subject}' refusé" subject: "[Agenda du Libre] Événement '%{subject}' refusé"