Commit Graph

51 Commits

Author SHA1 Message Date
Javi Martín
f87d4b589d Add and apply Naming/BlockForwarding rubocop rule
This syntax has been added in Ruby 3.1.

Not using a variable name might not be very descriptive, but it's just
as descriptive as using "block" as a variable name. Using just `&` we
get the same amount of information than using `&block`: that we're
passing a block.

We're still using `&action` in `around_action` methods because here we
aren't using a generic name for the variable, so (at least for now) we
aren't running this cop on controllers using `around_action`.
2023-09-12 15:17:28 +02:00
Javi Martín
a1439d0790 Apply Layout/LineLength rubocop rule
Note we're excluding a few files:

* Configuration files that weren't generated by us
* Migration files that weren't generated by us
* The Gemfile, since it includes an important comment that must be on
  the same line as the gem declaration
* The Budget::Stats class, since the heading statistics are a mess and
  having shorter lines would require a lot of refactoring
2023-08-30 14:46:35 +02:00
decabeza
f63609a798 Add helpers for mailer footer styles 2022-08-04 17:16:05 +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
a102f3f0a7 Add and apply Style/ExplicitBlockArgument rule
We were already applying it in most places.
2021-08-09 19:11:29 +02:00
Javi Martín
db97f9d08c Add and apply rubocop rules for empty lines
We were very inconsistent regarding these rules.

Personally I prefer no empty lines around blocks, clases, etc... as
recommended by the Ruby style guide [1], and they're the default values
in rubocop, so those are the settings I'm applying.

The exception is the `private` access modifier, since we were leaving
empty lines around it most of the time. That's the default rubocop rule
as well. Personally I don't have a strong preference about this one.


[1] https://rubystyle.guide/#empty-lines-around-bodies
2019-10-24 17:11:47 +02:00
Javi Martín
9c3686a6d8 Remove unused block parameters
We're using `yield` in the method body.
2019-10-05 15:03:25 +02:00
Javi Martín
47b2c42a1d Apply IndentationConsistency rubocop rule 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
9f21d9c64e Use double quotes in app/mailers 2019-03-15 09:27:01 +01:00
Julian Herrero
00bd7008bb Show all system emails in Admin section 2019-02-22 16:13:49 +01: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
María Checa
8d2a103744 Changed how newsletters controller and mailer handle recipients
Now newsletters controller calls the Mailer method to send a newsletter once per user.
2018-02-28 17:02:31 +01:00
María Checa
20173f9870 Added newsletter mailer method and view 2018-02-13 13:12:00 +01:00
Bertocq
69f4e1c683 Fix all rubocop Metrics/LineLength issues (140+) 2017-07-10 13:22:49 +02:00
Raimond Garcia
09a2f2b795 Merge pull request #1660 from consul/fix/rubocop_issues
Fix some Rubocop issues
2017-06-20 21:49:59 +02:00
Juanjo Bazán
315c57929a allows managers to create users without email
allows managers to create users without email

hides email preferences from account page for email-less users

prevents email delivery to users with no email

adds spec for user creation from management

adds specs for user's email requirement

adds spec for no deliveries if no email
2017-06-19 13:02:48 +02:00
Bertocq
f6863f5ea0 Rubocop autocorrect Performance/RedundantBlockCall issue and remove it from rubocop_todo list 2017-06-19 10:45:18 +02:00
rgarcia
712e576e75 adds email delivery of selected and unselected investments 2017-05-12 13:57:31 +02: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
rgarcia
b087fe8fb7 refactors email digest 2016-08-03 19:33:37 +02:00
rgarcia
ad1720ba02 uses applications's default locale 2016-06-27 23:38:23 +02:00
rgarcia
745de9bb77 sends invitation email to users 2016-06-27 23:37:58 +02:00
Alberto Garcia Cabeza
017ccfb378 Changes title and subject in email 2016-06-15 20:49:29 +02:00
rgarcia
28d12fe55b removes sending individual proposal notifications via email 2016-06-15 10:43:02 +02:00
rgarcia
ce6072d17b sends a copy of the direct message to the sender 2016-06-14 18:55:28 +02:00
rgarcia
6e800c5120 adds email digest for proposal notifications 2016-06-14 17:53:36 +02:00
rgarcia
c3d06c8bd0 adds direct messages 2016-06-08 20:44:54 +02:00
Alberto Garcia Cabeza
e550a40f90 Adds share and comment button on email 2016-06-07 16:12:16 +02:00
rgarcia
ca26b3423b sends notification email to each voter 2016-06-01 21:40:23 +02:00
Juanjo Bazán
1e35169694 fixes i18n calls 2016-04-04 14:43:49 +02:00
rgarcia
db5348938e adds code to email subject 2016-03-28 14:08:39 +02:00
rgarcia
9aaeb23e7f sends an email for unfeasible spending proposals 2016-03-28 12:16:07 +02:00
Josep Jaume Rey Peroy
cf00f12ec7 Store locale in a user's field and switch locale on mailers 2016-01-22 18:10:28 +01:00
rgarcia
ef2e7ca4f9 fixes specs 2015-11-09 14:27:56 +01:00
kikito
9e05a3283c Includes the document number and type in the verification email 2015-10-02 18:40:24 +02:00
Juanjo Bazán
39d1c3d504 fixes i18n error 2015-09-25 13:47:42 +02:00
Juanjo Bazán
3f46b27371 Fixes comment notifications mailers
It was not commendable independent so avery email related with a comment on a proposal was not being sent. Removes dependency on debates and makes it commentable independent.
2015-09-24 12:41:11 +02:00
Juanjo Bazán
08a1968fd2 adds mailer helper 2015-09-24 12:38:21 +02:00
David Gil
31cf51f07a adds text_with_links helper and use that in any comment.body in views, adds test to check for malicious injections in comment body 2015-09-10 18:28:10 +02:00
rgarcia
570f67195c adds email verification 2015-08-27 23:57:04 +02:00
Juanjo Bazán
c08d2cdf08 improves emails
Adds texts and i18n, ready to add design now.
Advances #221
2015-08-21 23:01:51 +02:00