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

Add button for sending test email #20194

Closed
wants to merge 2 commits into from

Conversation

Piccirello
Copy link
Member

@Piccirello Piccirello commented Dec 28, 2023

This allows for easily testing whether the provided email configuration is correct. Testing otherwise requires downloading a torrent until completion.

Note that the email is sent using the values currently saved to the config file; NOT necessarily the information currently entered into the options dialog. I'm open to ideas on how to make this more apparent to the user.

@Piccirello Piccirello marked this pull request as ready for review December 28, 2023 23:40
src/app/application.cpp Outdated Show resolved Hide resolved
src/app/application.h Outdated Show resolved Hide resolved
@glassez glassez requested a review from a team December 30, 2023 11:53
@glassez glassez added this to the 5.0 milestone Dec 30, 2023
connect(m_ui->sendTestEmail, &QPushButton::clicked, this, [this]
{
app()->sendTestEmail();
QMessageBox::information(this, tr("Test email"), tr("Email has been sent"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Email has been sent

Misleading to show this even when it fails.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with you. I wanted to provide some confirmation to the user, since the interaction feels indeterminant without it. But the smtp code runs async, so we don't yet know if the message will send successfully. Maybe the message should be altered?

Copy link
Contributor

@LordNyriox LordNyriox Dec 30, 2023

Choose a reason for hiding this comment

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

Maybe the message should be altered?

Perhaps you could squeeze an attempted into the notification?

Email sending has been attempted

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the message should be altered?

"An attempt to send an email has been made"?
I don't have a good suggestion...

Copy link
Member Author

Choose a reason for hiding this comment

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

I went with "Attempted to send email. Check your inbox to confirm success".

This allows for easily testing whether the provided email configuration is correct.
connect(m_ui->sendTestEmail, &QPushButton::clicked, this, [this]
{
app()->sendTestEmail();
QMessageBox::information(this, tr("Test email"), tr("Attempted to send email. Check your inbox to confirm success"));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't there be any punctuation mark at the end of the second sentence?

Copy link
Member Author

Choose a reason for hiding this comment

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

From looking at other messages, no. They generally omit punctuation entirely, and in the case there are multiple sentences, the last omits punctuation.

Copy link
Member

Choose a reason for hiding this comment

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

From looking at other messages, no. They generally omit punctuation entirely, and in the case there are multiple sentences, the last omits punctuation.

Is it a good idea to follow the existing incorrect things?
Well, I'm not insisting. They all can be fixed later.

Copy link
Member

@glassez glassez left a comment

Choose a reason for hiding this comment

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

Note, that conflicts should be resolved before it can be merged.

Comment on lines +1712 to +1713
url: 'api/v2/app/sendTestEmail',
method: 'post',
Copy link
Member

Choose a reason for hiding this comment

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

Is it intended to be POST method only? If so, please add entry here:

{{u"app"_s, u"setPreferences"_s}, Http::METHOD_POST},
{{u"app"_s, u"shutdown"_s}, Http::METHOD_POST},

@Chocobo1
Copy link
Member

Chocobo1 commented Mar 2, 2024

There are merge conflicts and some other required changes. I'll handle them in PR #20488.

@Piccirello
Thank you!

@Chocobo1 Chocobo1 closed this Mar 2, 2024
@glassez glassez reopened this Mar 6, 2024
@glassez glassez closed this Mar 6, 2024
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.

5 participants