Skip to content

Fix welcome mails not being sent#10470

Closed
arusa wants to merge 1 commit intodecidim:developfrom
DecidimAustria:fix/welcome_mails_not_being_sent
Closed

Fix welcome mails not being sent#10470
arusa wants to merge 1 commit intodecidim:developfrom
DecidimAustria:fix/welcome_mails_not_being_sent

Conversation

@arusa
Copy link
Copy Markdown
Contributor

@arusa arusa commented Mar 2, 2023

10 Months ago there was a check added, that only allows notification mails to be sent to users with notifications_sending_frequency == "real_time"

The problem with that is, that in decidim 0.27 new users don't get any welcome notification mails anymore, because new users by default have notifications_sending_frequency set as "daily".

I just commented out the line that breaks welcome mails for my decidim installation.

A better fix would probably be to make an exception for the event "decidim.events.core.welcome_notification".

Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could find another way of disabling this line...

@ahukkanen
Copy link
Copy Markdown
Contributor

ahukkanen commented Mar 7, 2023

I think we could pass some extra data with the extra key when we publish the event here:

def after_confirmation

We could add there e.g. extra: { force_email: true } and then detect it properly within the EmailNotificationGenerator that is being edited in this PR. I.e. when we have this key within the "extra" data, send the email regardless of the user's notification settings.

So regarding this, few questions to @arusa :

  1. Would you like to do this change with your PR?
  2. Could you also include regression tests with your PRs so that we will not reintroduce such bugs when we do refactoring on the codebase?
  3. Could you fill in the PR template please?

Let us know, so we know how to proceed with this.

As a side effect, I think the user might receive the welcome notification twice, once as the initial email and once with the daily/weekly digest email but I would see this acceptable tradeoff just to fix this issue at hand. Otherwise we would need to change the notification email to be an individual email outside of the event context + do also some changes in the event notification programming API to support preventing sending some particular emails. The suggested approach would be much simpler to implement.

@alecslupu
Copy link
Copy Markdown
Contributor

@arusa , please see @ahukkanen's comment.

@andreslucena
Copy link
Copy Markdown
Member

As this PR didn't have any much activity since a couple of months, I went ahead and fixed the original problem on #10991.

Thanks for the report @arusa and thanks for the explanation on how to fix this @ahukkanen

I'm closing this issue as its already handled on #10991

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants