manager: add Mailjet emails to the sent emails list

This commit is contained in:
Pierre de La Morinerie 2021-04-13 08:57:26 +00:00
parent 773c18babf
commit 16f695031b
3 changed files with 59 additions and 3 deletions

View file

@ -49,7 +49,18 @@ module Manager
def emails
@user = User.find(params[:id])
@sent_mails = Sendinblue::API.new.sent_mails(@user.email)
email_services = [
Mailjet::API.new,
Sendinblue::API.new
]
@sent_mails = email_services
.filter(&:properly_configured?)
.map { |api| api.sent_mails(@user.email) }
.flatten
.sort_by(&:delivered_at)
.reverse
end
def unblock_email