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

dev/mail#2141 - MailSettings - Add button+API for testing a connection #18911

Merged
merged 2 commits into from
Nov 5, 2020

Conversation

totten
Copy link
Member

@totten totten commented Nov 3, 2020

Overview

When an administrator creates inbound mail settings (Administer => CiviMail => Mail Accounts), it asks for a number of picky details -- like username, password, server, protocol, etc. This patch makes it easier to validate those details.

Before

There is no option to test a connection. You would have to configure a cron-worker for that connection, run it, and check its output. (Or, you have to figure out some complicated cv php:eval commands... which is what I was doing before...)

After

The "Edit Mail Account" presents a button "Save & Test" (inspired by the similar button used on "Outbound Mail" settings).

Screenshot from 2020-11-02 22-43-19

If it succeeds, then it shows a happy message:

Screenshot from 2020-11-02 22-44-19

And if it fails, then it shows a sad message:

Screenshot from 2020-11-02 22-43-30

Technical Details

The logic of the test is wrapped in a APIv4 action (MailSettings.testConnection) to make it easier to use in more contexts (eg CLI).

@civibot
Copy link

civibot bot commented Nov 3, 2020

(Standard links)

@civibot civibot bot added the master label Nov 3, 2020
@totten
Copy link
Member Author

totten commented Nov 3, 2020

jenkins, test this please

@eileenmcnaughton
Copy link
Contributor

Looks good - @stesi561 any chance you could do an r-run on this?

@totten
Copy link
Member Author

totten commented Nov 5, 2020

@demeritcowboy It sounds like you used the "Save & Test" option as part a run-through?

Then later when you set up the mail account, when you click the save and test, the success alerts don't have the usual green icon.

FWIW, I've had this problem too, but I think it's a separate issue -- for me, at different times, I've had either (a) all alert icons work or (b) no alert icons. Haven't tracked it down. I figured maybe it was a blip of some independent work going on in master? Or maybe an issue with my local deployment? But I saw it on other screens, and it cleared up after some rebuild, so I figured it wasn't an issue with this.

@demeritcowboy
Copy link
Contributor

Yes I used "save and test" as part of run-through - I didn't fully test this PR specifically but yes I ended up clicking it and so have done a minimal r-run of the button.

Will keep an eye out for other missing alert icons.

@demeritcowboy
Copy link
Contributor

Maybe I can blame composer for the missing icons. It's been at least a day since I blamed composer for something.

@stesi561
Copy link
Contributor

stesi561 commented Nov 5, 2020

This sounds great. Ping me if you need additional r-run beyond what @demeritcowboy has done.

@eileenmcnaughton eileenmcnaughton merged commit 46795cd into civicrm:master Nov 5, 2020
@totten totten deleted the master-mail-test branch November 5, 2020 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants