Commit Graph

88 Commits

Author SHA1 Message Date
Javi Martín
87d7923f0d Open mailer links in the same window
We do it most of the time, so I'm not sure why we weren't doing it in
these cases.
2023-10-24 16:31:39 +02:00
Javi Martín
1a098dfcab Add and apply MultilineMethodCallBraceLayout rule
In order for this rule to work effectively when running `--autocorrect`,
we also need to enable the `ClosingParenthesisIndentation` rule.
2023-08-18 14:56:16 +02:00
Javi Martín
629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00
taitus
73f710e737 Unify format and indentation for sanitize, i18n and links on emails
In the mail section we have very different indentations and formatting in
 texts with sanitize, links and texts with interpolations. In my opinion it
helps a lot to have clearer indentations in these cases.

This may not be the best way to indent them, but at least I think it is
clearer than it was and at least relatively unified.
2022-06-02 17:56:18 +02:00
decabeza
8c078ae0a9 Add missing heading title on mailers 2022-06-02 17:56:18 +02:00
decabeza
bec59f1f9f Remove icon images on mailers 2022-06-02 17:56:18 +02:00
decabeza
7f0f35a5c0 Add mailer helpers to simplify customization 2022-06-02 17:56:15 +02:00
taitus
d871bb9eae Unify render "quotes" on emails
This section was being displayed differently in each mailing. We are trying
to unify it so that they are displayed the same.
2022-06-02 11:24:19 +02:00
taitus
d0224d1903 Add attributes for sanitize on unsubscribe link section
In the comments and direct message emails, the "attributes" was
missing and in the reply email it was not in the right place.
2022-06-02 11:24:19 +02:00
taitus
41b9705563 Unify unsubscribe section styles with others emails 2022-06-02 11:24:19 +02:00
taitus
7ff62532df Unifiy proposal notification digest with others emails
The notification digest title did not look the same as other mail.  We
removed the table for the title to make it more consistent with the rest of
the emails.
2022-06-02 11:24:19 +02:00
Julian Herrero
ad018c6f39 Send informative email for already confirmed users
Currently the application does not send any email to confirm the
account for already confirmed users. But we show a notice message
that may look like you will recive one:

"If your email address exists in our database, you will receive
 an email with instructions for how to confirm your email address
 in a few minutes."

In this commit we keep the original message, but send an email to
the user informing them that their account is now registered.

This way no one can know if someone else's account is confirmed and
we don't have to worry about GDPR either.

Co-Authored-By: taitus <sebastia.roig@gmail.com>
2022-04-19 17:03:02 +02:00
taitus
13965901f8 Update "newsletter" notification email to add unsubscribe link 2022-01-21 20:21:52 +01:00
taitus
1fcbd49448 Update "reply" notification email to add unsubscribe link
We modified the link that previously redirected us to the "My content"
page to redirect us to the new page for managing subscriptions.

We also adapted the existing generic text by adding a description of
the related notification.
2022-01-21 20:21:52 +01:00
taitus
478ac3a952 Update "proposal" notification email to add unsubscribe link
We modified the link that previously redirected us to the "My content"
page to redirect us to the new page for managing subscriptions.
2022-01-21 20:21:52 +01:00
taitus
a36f3feb87 Update "direct message" notification email to add unsubscribe link
We modified the link that previously redirected us to the "My content"
page to redirect us to the new page for managing subscriptions.
2022-01-21 20:21:52 +01:00
taitus
0af765a3bd Update "comment" notification email to add unsubscribe link
We modified the link that previously redirected us to the "My content"
page to redirect us to the new page for managing subscriptions.

We also adapted the existing generic text by adding a description of
the related notification.
2022-01-21 20:21:52 +01:00
Machine Learning
4d27bbebad Add experimental machine learning 2021-08-16 16:31:04 +02:00
Javi Martín
2d37a0396b Apply Layout/ExtraSpacing rule in ERB files
Note that in Ruby files this rule allows vertical alignment, but doesn't
seem to do the same in ERB. Since we only used vertical alignment in one
place, and that place also had an unneeded extra space on every aligned
line, I've decided to change the code in that place and follow the rule.
2021-02-05 17:46:23 +01:00
Andy Sims
74fbde09f1 Support creates follow (Merge pull request #3895)
* Supporting a proposal will create a follow relationship
* Only followers receive notifications
2020-04-06 15:26:47 +02:00
Javi Martín
ae2576020e Extract method to use WYSIWYGSanitizer in views
This is similar to methods we use like `sanitize` or `markdown`.
2019-10-21 21:32:02 +02:00
Javi Martín
6b1864fbcd Sanitize translations instead of using _html
Using the `_html` suffix in an i18n key is the same as using `html_safe`
on it, which means that translation could potentially be used for XSS
attacks.
2019-10-09 19:46:47 +02:00
Javi Martín
b66859945e Remove _html suffix from already sanitized texts
Using the `_html` suffix automatically marks texts as HTML safe, so
doing so on sanitized texts is redundant.

Note flash texts are not sanitized the moment they are generated, but
are sanitized when displayed in the view.
2019-10-09 19:46:47 +02:00
Javi Martín
928312e218 Use sanitize in translations with links
Sometimes we're interpolating a link inside a translation, and marking
the whole translations as HTML safe.

However, some translations added by admins to the database or through
crowdin are not entirely under our control.

Although AFAIK crowdin checks for potential cross-site scripting
attacks, it's a good practice to sanitize parts of a string potentially
out of our control before marking the string as HTML safe.
2019-10-08 18:46:21 +02:00
Javi Martín
56f690b8a9 Use attributes in translations with sanitize
There's a slight chance an attribute like an author's name might contain
an attempt to perform XSS attacks. So, instead of marking the whole text
as HTML safe, we can sanitize it.

Also note I'm removing the `_html` suffix in the i18n key, since it's
got the same effect as using `html_safe`.
2019-10-08 18:46:21 +02:00
Javi Martín
2aabf79fb4 Rename methods to add auto links to HTML
The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
2019-10-08 18:46:20 +02:00
Javi Martín
0f485308b7 Sanitize CKEditor content before displaying it
It's possible to create a newsletter or a proposed action with
<script> tags by filling in the body using a textarea instead of a
CKEditor. While we trust our administrators not to do so, it's better to
completely eliminate that possibility.
2019-10-08 18:46:20 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Javi Martín
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
Javi Martín
71d9ddd849 Apply rule to end files with a newline character 2019-09-10 20:02:15 +02:00
lalo
28815cb290 Create new email template for new evaluation comment created and add it to system_emails view 2019-06-05 16:22:12 +02:00
voodoorai2000
d0b8fef6b3 Delete spending proposals 2019-05-31 18:22:59 +02:00
Julian Herrero
f6489bc604 Use double quotes in app/views 2019-03-19 12:33:07 +01:00
Julian Herrero
00bd7008bb Show all system emails in Admin section 2019-02-22 16:13:49 +01:00
decabeza
f2ec836587 Removes custom content on mailers 2018-07-30 17:57:25 +02:00
Bertocq
ac9f85e208 Change Proposal Notification Digest link to anchor
On the proposal notification digest messages there was a link to each
notification. Instead we need that link to point towards the notifications
tab of the proposal.
2018-07-25 20:20:33 +02:00
María Checa
20173f9870 Added newsletter mailer method and view 2018-02-13 13:12:00 +01:00
decabeza
962dd097b7 fixes i18n 2017-05-12 19:12:19 +02:00
decabeza
e8be4508fd improves i18n of budgets mailers 2017-05-12 18:50:03 +02:00
rgarcia
712e576e75 adds email delivery of selected and unselected investments 2017-05-12 13:57:31 +02:00
decabeza
6217dbae63 adds new i18n on budget investment unselected mailer 2017-05-12 12:47:57 +02:00
decabeza
7a803999bd adds missing td tag on budget investment created mailer 2017-05-12 12:43:52 +02:00
decabeza
53d3282d8b adds budget mailer for selected and unselected 2017-05-12 12:43:30 +02:00
Alberto Garcia Cabeza
1de39edf92 adds styles and i18n for mailer budget investment created 2017-01-15 13:52:09 +01:00
rgarcia
68bf119c18 sends unfeasible budget investment 2017-01-14 17:02:33 +01:00
rgarcia
82322ee233 sends budget investment created email 2017-01-14 16:10:43 +01:00
Alberto Garcia Cabeza
e8312ff86a fixes text format on direct messages 2016-10-18 16:40:59 +02:00
rgarcia
745de9bb77 sends invitation email to users 2016-06-27 23:37:58 +02:00
Alberto Garcia Cabeza
0bb948a013 Updates mailer texts 2016-06-27 16:01:03 +02:00
Alberto Garcia Cabeza
a2a2960867 Adds mailer template for user invites 2016-06-27 15:37:45 +02:00