add unsubscribe to email
If a user has opted out of emails then invitation mail will not be sent to the user
This commit is contained in:
parent
a96722b3c3
commit
9cc74e051c
3 changed files with 5 additions and 1 deletions
|
|
@ -7,7 +7,7 @@ module Invitation
|
|||
|
||||
emails_array.each do |email|
|
||||
new_user = User.find_by(email: email)
|
||||
if new_user.nil?
|
||||
if new_user.nil? || !new_user.opted_out?
|
||||
User.invite!({ email: email }, current_user)
|
||||
new_user = User.find_by(email: email)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -9,3 +9,5 @@
|
|||
<% end %>
|
||||
|
||||
<p><%= t("devise.mailer.invitation_instructions.ignore") %></p>
|
||||
<hr>
|
||||
<small>Click on <%= link_to "Unsubscribe", mailkick_unsubscribe_url %>, to stop receiving invitation mails.</small>
|
||||
|
|
|
|||
|
|
@ -9,3 +9,5 @@
|
|||
<% end %>
|
||||
|
||||
<%= t("devise.mailer.invitation_instructions.ignore") %>
|
||||
|
||||
Click on <%= mailkick_unsubscribe_url %>, to stop receiving invitation mails.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue