api.php or any project api.php file:'default' => [
'transport' => 'sendmail',
'from' => '[email protected]'
]
/mail endpoint and provide access via token:POST /_/mail?access_token=adminUserSecretToken
{
"to": [
"[email protected]"
],
"subject": "New Password",
"body": "Hello <b>{{name}}</b>, this is your new password: {{password}}.",
"type": "html",
"data": {
"name": "John Doe",
"password": "secret"
}
}
The sender address is: [email protected]
The sender address is the email address of the (admin) user corresponding to the used access_token: [email protected]
Nope.
Thank you for pointing this out @stefanvangastel. We'll be looking at this issue soon 馃檪
Hello @stefanvangastel , this is working as expected. What you're trying to achieve can be added as an enhancement though. Let me explain,
The api.config file has mail settings which are being used when the system sends an email for activities like:
The /mail endpoint is open for all the users. It identifies the user from access token & sets the email of the user as the sender. Now there may be some cases where you might need to tweak this behaviour. To do that we can add an extra parameter use_default_email which will use the email address from the configuration.
This may create a situation where other user can also pass this parameter and represent them as a system email. So we can add check that if the token is of an admin then only use_default_email will come to a picture!
Let me know your thoughts @benhaynes @rijkvanzanten
@bjgajjar That explains a lot. Thanks. I understand this point of view and the suggested feature would be very helpful for my (and I expect other) use-case(s).
Makes sense, thanks Binal!
Let's shift this ticket to a feature request for now and we can look into adding it later. For now the priority is bug fixes and stability.
Fixed in #911
Most helpful comment
Makes sense, thanks Binal!
Let's shift this ticket to a feature request for now and we can look into adding it later. For now the priority is bug fixes and stability.