I'm trying to use Laravel 5.7's new email verification feature. Let's say I'm logged in as Admin inside the admin panel and I want to:
Create a random user via admin panel.
Send an email verification to that created user's email.
How can I accomplish this with the new Laravel 5.7 email verification feature?
The built in verification scaffolding provides a notification to do this. You just need to ensure that the user's verified_at is set to null and then
use Iluminate\Auth\Notifications\VerifyEmail;
$user->notify(new VerifyEmail);
This will resend a new email with a signed URL.
Related
I need to send an email to the users whenever I create a new user from my backoffice. So I should access to the util that creates the strapi code for resetting passwords when I do it with the built in plugin.
Basically I create a new user -> send welcome email to the new user and link to set a new password -> User clicks on the link and redirects him to the password reset page.
Any idea on how create this code in a custom API?
I use react + strapi v4.1.5
Problem is:
User registers at the side and gets a registration email with a
confirmation link which can be used. and
Admin gets an email notification of a newly registered user
Admin activates & enables the user
No notification email to the user is sent about his accounts activation
No hints in the logs. Mailserver is working as described. Tests with System emails active for users show no difference in the behavior. Also added true to $return = JFactory::getMailer()->sendMail($data['mailfrom'], $data['fromname'], $data['email'], $emailSubject, $emailBody, true); in registeration.php
Does this feature actually work? Any help in solving this would be much-appreatiated.
Using Joomla 3.9.15 and no external plugins for user-management.
Thanks in advance for your time.
Joomla distinguishes between user activation by link through email or via administration backend. In order to send an email to the user after the activation of the user account one needs to use the link from the email. Activation from the administration backend will not send an email to the user who's account was activated.
So I was wondering, how would I send my email from another email address in Laravel. Currently I have this email address and domain. This is an example. Sender = test#domain.com
Now I have many auth()
users. I want to be able for them to send emails as well. So how would I do that? So for an example: Test#anotherdomain.com
My point is, currently the admin guard is able to send an email to the owner of the post who is user(). I have multi auth so admin is one guard and the other is the default.
So the admin is able to send email to test#domain.com
So how can I do it so that test#anotherdomain.com can send an email back to test#domain.com
Is this even possible?
Note: I am using mailgun.
You have two option in this situation:
1) use email clients independently like Phpmailer or Swiftmailer
2) change the config file and email credentials on the fly(make sure your config isn't cached)
Accessing Configuration Values
Some users of our application are admins. We want give them a capability to create new users. We think about the following flow:
Admin goes to "Users" page and clicks a "create a new user" button and fill new user's name and email address.
That new user retrieves an email with acknowledge that a user was created in our application.
The user clicks a link from email body and proceeds to "Set password" page and specify his password.
Is it possible to achieve such flow with angular + express? Is there any other possible flows which can be achieved?
You can create an invite-based flow, but you'll have to do some custom work with our libraries.
You'll need to work with the Stormpath Client and Stormpath Application directly, these are provided by the Stormpath Node SDK. Inside of your Express middleware, retrieve the client with:
var stormpathClient = req.app.get('stormpathClient')
and the application with:
var stormpathApplication = req.app.get('stormpathApplication`)
On the application, use stormpathApplication.createAccount() to create the user. When you pass the new account data, set the password to something that is very long, random, and un-guessable. If your Stormpath directory has email verification enabled, the user will get an invite email. That email should link them into your Angular application, to a custom view which will read the email verification token from the URL and post it to a custom middleware on your server. This middleware will need to use stormpathClient.verifyAccountEmail() to verify the token.
Then you can collect a new password for the user, and save it by setting req.user.password='new password', then calling req.user.save().
Hope this helps! I work at Stormpath and I am a maintainer of these libraries :)
I am working on a Laravel 4.2 project.
I already have implemented an email activation module for new user registration. Whenever a new user registers, I provide an activation link to him in an email and clicking on link, I compare the token (a random string with 30 characters) I have provided with link and user's email address with database records. If found to be matching, I just set is_active field of users table to true and redirect him to login page with a Congratulations message for successful activation.
But now, I DON'T want him to redirect to login page, but if successful activation, I want him logged in directly to his account.
But I believe that authenticate an user with just a string token and email address is not a secure way.
There must be something that I can trust on. Many sites do this including stackoverflow itself but I am not sure how?
Can you please guide me how to do this?