Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to ContactEmailSender to create email log even when there is SMTP setting #1508

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

Ivanov-Anton
Copy link
Collaborator

@Ivanov-Anton Ivanov-Anton commented Jul 17, 2024

Description

when we perform ContactEmailSender.batch_send_emails(contacts, subject: 'text', message: 'message')

the Email log is not created due there is no any SMTP configs even global

To imptove this logic I suggest to remove not null constraint from mail_from column of notifications.email_logs table and do not fill in this column when we perform batch_send_emails method.
As result we will able to view Email Log (Logs->Email Log) and determinate that curently there is no any SMTP config and it should be created for specific contact or Global one.

Additional links

closes #1395

@Ivanov-Anton Ivanov-Anton self-assigned this Jul 17, 2024
@Ivanov-Anton Ivanov-Anton marked this pull request as draft July 17, 2024 09:48
@Ivanov-Anton Ivanov-Anton force-pushed the YETI-WEB-1395-AccountBalanceNotify branch 2 times, most recently from e7df11b to 95144f9 Compare July 17, 2024 10:46
@@ -23,7 +23,6 @@
expect { subject }.to change { Log::EmailLog.count }.by(1)
email_log = Log::EmailLog.last!
expect(email_log).to have_attributes(expected_email_log_attrs)
expect(Worker::SendEmailLogJob).to have_been_enqueued.with(email_log.id)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed because at the 31 line we have already perform this test

@Ivanov-Anton Ivanov-Anton force-pushed the YETI-WEB-1395-AccountBalanceNotify branch 2 times, most recently from d098026 to 3dc28e7 Compare July 17, 2024 11:51
@Ivanov-Anton Ivanov-Anton force-pushed the YETI-WEB-1395-AccountBalanceNotify branch from 3dc28e7 to 0e052ab Compare July 17, 2024 12:01
@Ivanov-Anton Ivanov-Anton marked this pull request as ready for review July 17, 2024 16:39
@Ivanov-Anton Ivanov-Anton added the Waiting for code review It means that the owner or member of the repositor can do a code review. label Jul 17, 2024
@dmitry-sinina dmitry-sinina merged commit d80346a into master Jul 17, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for code review It means that the owner or member of the repositor can do a code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jobs::AccountBalanceNotify exception if no smtp connections available
2 participants