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 email test in plugin settings #8156

Merged
merged 41 commits into from
Mar 5, 2021

Conversation

MattieBelt
Copy link
Collaborator

@MattieBelt MattieBelt commented Oct 2, 2020

Description of what you did:

Fixes #5935, by adding a email plugin section to the settings page.

The email settings section contains the current configuration (disabled) and a button to send a test mail.

EDIT: updated image:
image

Any feedback is welcome.

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Move Test button
Add testEmail input
Update config fields

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
@derrickmehaffy
Copy link
Member

I would suggest renaming Testing to Send a test email

Also I'm curious if the default send/reply emails are actually used 🤔

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
@MattieBelt
Copy link
Collaborator Author

renaming Testing to Send a test email

That's indeed better @derrickmehaffy, see updated image.

Also I'm curious if the default send/reply emails are actually used 🤔

It depends on the provider:

const send = async options => {
return strapi.plugins.email.provider.send(options);
};

All the official provider use the defaultFrom & defaultReplyTo and most community providers also (that I know off).

@derrickmehaffy
Copy link
Member

derrickmehaffy commented Oct 2, 2020

Awesome :) I want the frontend team to just review to make sure they don't have any comments so this might not get merged til around monday but we will see.

Other than that, I think this addition is awesome, thank you!

@derrickmehaffy derrickmehaffy added the flag: don't merge This PR should not be merged at the moment label Oct 2, 2020
@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #8156 (264a368) into master (96cf541) will decrease coverage by 0.07%.
The diff coverage is 7.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8156      +/-   ##
==========================================
- Coverage   35.95%   35.88%   -0.08%     
==========================================
  Files        1335     1342       +7     
  Lines       14726    14809      +83     
  Branches     1468     1476       +8     
==========================================
+ Hits         5295     5314      +19     
- Misses       8514     8576      +62     
- Partials      917      919       +2     
Flag Coverage Δ
front 27.25% <1.92%> (-0.13%) ⬇️
unit 55.54% <26.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ges/strapi-admin/admin/src/containers/App/index.js 0.00% <0.00%> (ø)
...rapi-admin/admin/src/containers/App/utils/index.js 0.00% <0.00%> (ø)
...dmin/src/containers/App/utils/unique-identifier.js 0.00% <0.00%> (ø)
...trapi-admin/admin/src/containers/AuthPage/index.js 0.00% <ø> (ø)
...c/containers/NewNotification/Notification/index.js 0.00% <ø> (ø)
packages/strapi-generate/lib/target.js 11.22% <0.00%> (ø)
...ger/admin/src/components/AddDropdown/components.js 0.00% <ø> (ø)
...anager/admin/src/components/SelectWrapper/index.js 0.00% <ø> (ø)
...anager/admin/src/components/WysiwygEditor/index.js 0.00% <ø> (ø)
.../containers/EditViewDataManagerProvider/reducer.js 0.00% <ø> (ø)
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0903d5b...6ffccfb. Read the comment docs.

@derrickmehaffy derrickmehaffy removed the flag: don't merge This PR should not be merged at the moment label Oct 2, 2020
@derrickmehaffy derrickmehaffy added this to the 3.2.0 milestone Oct 2, 2020
Copy link
Member

@alexandrebodin alexandrebodin left a comment

Choose a reason for hiding this comment

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

You will need to add the permissions to the backend so they can be selected in the Admin panel :)

Copy link
Contributor

@soupette soupette left a comment

Choose a reason for hiding this comment

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

Thanks a lot @MattieBelt for your contribution!

Can you check the permissions defined can be managed in the permission view otherwise this new setting section will never be visible.

@alexandrebodin alexandrebodin removed this from the 3.2.0 milestone Oct 6, 2020
@soupette
Copy link
Contributor

soupette commented Oct 8, 2020

@MattieBelt do you need any help for fixing the requested changes?

@MattieBelt
Copy link
Collaborator Author

Hey @soupette, no. Just didn't have any time yet. Plannend on looking into it this morning. Thanks for the feedback already!

@MattieBelt
Copy link
Collaborator Author

Hey @soupette,
Thanks again for the feedback. I do have some questions/remarks tho.

  • My reasoning behind not using a submit, is because the form isn't submitted, only the testEmailAddress can be 'overwritten' and the value will be used to test. The test button will not update anything only send an test email. Does this still need to be handled as a submit?
  • Regarding this comment, this way people can not spam the test button and send a lot of emails. (any ideas for this)
  • I will update the permissions, forgot to completely implement those.
  • How does the default email provider work? Without configuring anything Strapi will still send an email (from:no-reply@strapi.io). Any ideas to prevent spam?

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
@derrickmehaffy
Copy link
Member

  • My reasoning behind not using a submit, is because the form isn't submitted, only the testEmailAddress can be 'overwritten' and the value will be used to test. The test button will not update anything only send an test email. Does this still need to be handled as a submit?

Yeah you should be fine here, since we aren't changing data in the database, we are just firing an action (say for example like a webhook)

* Update mail text
* Fix alignment
* Add yup validation
* Update form submission

Signed-off-by: MattieBelt <mattiasvandenbelt@gmail.com>
This was referenced Mar 12, 2021
@derrickmehaffy derrickmehaffy removed this from WIP (Strapi or Community) in [Experiment] Feature Board Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Issue suggesting a new feature source: core:email Source is core/email package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a "test email" button on email providers