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

[4]send email on new user via webservice #37149

Merged
merged 4 commits into from Mar 11, 2022
Merged

[4]send email on new user via webservice #37149

merged 4 commits into from Mar 11, 2022

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Feb 26, 2022

Pull Request for Issue #37128 .

Summary of Changes

fix send email when the user is created via webservices

Testing Instructions

create a new user POST {{base_path}}/api/index.php/v1/users

{
    "block": "0",
    "email": "apipr@mail.com",
    "groups": [
        "2"
    ],
    "id": "0",
    "lastResetTime": "",
    "lastvisitDate": "",
    "name": "apipr",
    "params": {
        "admin_language": "",
        "admin_style": "",
        "editor": "",
        "helpsite": "",
        "language": "",
        "timezone": ""
    },
    "password": "qwertyqwerty123",
    "password2": "qwertyqwerty123",
    "registerDate": "",
    "requireReset": "0",
    "resetCount": "0",
    "sendEmail": "1",
    "username": "testAPIpr"
}

Actual result BEFORE applying this Pull Request

no email was sent

Expected result AFTER applying this Pull Request

email sent to the created new user

@nbradshaw45
Copy link

Thank you! This tested good!

However, I have a suggestion:

"sendEmail": (0 or 1) relates to receiving admin messages (the name is a little confusing).

I think it would make sense to add a new flag for send email to users on create - so that it is optional - there could be reasons why an admin may not want to send these emails.

So creating a new json element called "sendUserWelcomeEmail": values (0 or 1)

@toivo
Copy link
Contributor

toivo commented Feb 27, 2022

I have tested this item ✅ successfully on 76237c0

Tested successfully with Postman in 4.1.1-dev of 27 February in Wampserver 3.2.7 using PHP 8.0.15. The email was sent, received of course a non-delivery message to the Super User mailbox. The response:
{"links":{"self":"http://joomla4test/api/index.php/v1/users"},"data":{"type":"users","id":"809","attributes":{"groups":{"2":2},"id":809,"name":"apipr","username":"testAPIpr","email":"apipr@mail.com","block":0,"sendEmail":1,"registerDate":"2022-02-27 10:12:07","lastvisitDate":null,"lastResetTime":null,"resetCount":0}}}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37149.

Co-authored-by: George Wilson <georgejameswilson@googlemail.com>
@toivo
Copy link
Contributor

toivo commented Feb 28, 2022

I have tested this item ✅ successfully on 585690c

# Tested successfully with Postman in 4.1.1-dev of 28 February in Wampserver 3.2.7 using PHP 8.0.15. The email was sent all right.
The response:
{"links":{"self":"http://joomla4test/api/index.php/v1/users"},"data":{"type":"users","id":"811","attributes":{"groups":{"2":2},"id":811,"name":"apipr","username":"testAPIpr","email":"xxxxx@example.com","block":0,"sendEmail":1,"registerDate":"2022-02-28 08:58:38","lastvisitDate":null,"lastResetTime":null,"resetCount":0}}}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37149.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 2, 2022
@Quy Quy removed the RTC This Pull Request is Ready To Commit label Mar 2, 2022
@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 3, 2022
@wilsonge wilsonge removed the RTC This Pull Request is Ready To Commit label Mar 3, 2022
@toivo
Copy link
Contributor

toivo commented Mar 8, 2022

I have tested this item ✅ successfully on b09c1fb

Tested successfully - for the third time in 4.1.1-dev of 8 March in Wampserver 3.2.7 using PHP 8.0.15
The email was sent auccessfully. Response:
{"links":{"self":"http://joomla4test/api/index.php/v1/users"},"data":{"type":"users","id":"309","attributes":{"groups":{"2":2},"id":309,"name":"apipr","username":"toivo.user4","email":"admin@xxxxxx.com","block":0,"sendEmail":1,"registerDate":"2022-03-08 06:56:33","lastvisitDate":null,"lastResetTime":null,"resetCount":0}}}


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37149.

@Quy
Copy link
Contributor

Quy commented Mar 10, 2022

I have tested this item ✅ successfully on b09c1fb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37149.

@Quy
Copy link
Contributor

Quy commented Mar 10, 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37149.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 10, 2022
@laoneo laoneo merged commit d9f03e7 into joomla:4.1-dev Mar 11, 2022
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 11, 2022
@laoneo
Copy link
Member

laoneo commented Mar 11, 2022

Thanks!

@laoneo laoneo added this to the Joomla 4.1.1 milestone Mar 11, 2022
@alikon alikon deleted the patch-7 branch March 11, 2022 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants