Commit Graph

13 Commits

Author SHA1 Message Date
Julian Herrero
bb81a4dad4 improve action buttons aspect for small screens 2018-11-08 16:45:07 +01:00
voodoorai2000
7d5b57aee2 Add counter of emails sent to newsletter preview 2018-10-30 17:07:31 +01:00
decabeza
dd98375c67 Unifies styles and views for admin sending of emails section 2018-07-31 12:52:31 +02:00
decabeza
a669bd86a8 Improves layout and i18n for admin newsletters 2018-06-08 18:38:21 +02:00
decabeza
b2015312d8 Moves mailer header and footer to partials
This prevent use the entire HTML layout, an HTML inside another HTML
without using an iframe create some validation errors and break layout
details
2018-06-06 17:33:15 +02:00
Bertocq
6b41b6487b Add UserSegments#user_segment_emails helper method
Why:

Both Newsletters and Email Downloads need the same logic: To extract the
emails from all the users in the segment that have newsletter flag
active, removing all empty email values.

How:

1- UserSegments#user_segment_emails holds that repeated logic and is used
on both Newsletter & EmailDownload.

2- Rename Newsletter#list_of_recipients to list_of_recipient_emails as
it is more descriptive. There is no need to pass entire Users around,
only the emails are needed at Mailer#newsletter method.

3- Cleanup Newsletter#list_of_recipient_emails model spec scenario
2018-03-01 20:59:20 +01:00
Bertocq
24aa157998 Fix invalid Newsletter recipients count to 0
When a newsletter doesn't have a valid user segment for the recipients
list, the number of users should be 0.
2018-02-21 11:47:24 +01:00
Bertocq
f34d6c1c1d Prevent invalid newsletters from being sent
Why:

Newsletters without a valid user segment can't be sent since there is no
recipient user email list.

How:

* Hiding the send button at the form
* Preventing an invalid newsletter from being delivered at the controller
2018-02-21 11:47:16 +01:00
Bertocq
38f7a222f5 Add error message for invalid Newsletter user segment
Instead of the name of the User Segment we'll display an error message
2018-02-21 11:46:30 +01:00
Bertocq
4becd0eb35 Change Newsletter's segment_recipient to string
Why:

Newsletter attribute `segment_recipient` is an integer to be used as
enum. There's no advantage to store a number instead of an string if the
ammount of elements in the table is not going to be huge, or we can take
advantage of using an enum.

Also maintaining both Newsletters enum paired with UserSegments::SEGMENTS
would be a maintenance burden.

How:

* Migration to change segment_recipient column from integer to string
* Removing enumeration from Newsletter model class
* Using UserSegments::SEGMENTS instead of Newsletter.segment_recipients
or integer values
2018-02-21 11:46:11 +01:00
María Checa
881059811f Added newsletter admin views 2018-02-14 16:05:29 +01:00
Alberto Garcia Cabeza
04c33d1327 Improves styles for admin newsletters 2017-05-23 16:49:11 +02:00
rgarcia
2a7ff2270e sends zip file with test data 2017-05-23 16:45:34 +02:00