How can I change what appears in the password reset email in laravel?
Like addressing the user with his name and show the password reset link etc.
Where is that email view located?
In Laravel 5.3 they changed the entire password reset code, so the given answer doesn't work anymore.
If you want to change the basic texts you should copy vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php to some place in your own app (e.g. app/Notifications/ResetPassword.php), set the correct namespace and alter the texts as you wish. (don't alter the original ResetPassword.php since it's bad practice to alter files in the vendor folder!)
Then add a sendPasswordResetNotification method to the User class and make sure to reference to the appropriate ResetPassword class:
use App\Notifications\ResetPassword;
...
public function sendPasswordResetNotification($token) {
$this->notify(new ResetPassword($token));
}
If you want to change the rest of the mail template (which is used for all other mails as well) do the following:
Run php artisan vendor:publish
This will copy some blades from the vendor folder to the resources/views/vendor
The resources/views/vendor/notifications/email.blade.php is the one you want to change.
Hope this helps for people who got stuck in Laravel 5.3
Yes you can change the email template, which is located at
resources/views/emails/password.blade.php.
For customization pass an instance of User model to this view and echo out user name there like:
Hello, {{$user->username}}
//And Body of Reset link goes here
Update for laravel 5.3+
In updated laravel versions the code structure is revamped.
Password reset mail is now at vendor/laravel/framework/src/Illuminate/Auth/Notifications/ResetPassword.php
and its corresponding template is at:
resources/views/vendor/notifications/email.blade.php
So in order to customize it, you may need to:
Copy it to somewhere in your app's directory.
Set the proper namespace to refer to it.
Add a new method to User class & reference it to newly copied class
Customize.
Related
I have a form request and i want to let someone edit only his own request except from me and my team that we can always edit. So I need to set edit button visible only for my team and the original creator of the form. I used the user.email to get the email of the user who uses the app but I cant use equality netween this variable and the data card value as its incompatible user type. Text with table. How can i get the email in the data card and compare it to the users email?
actually it's quite easy, your requestorEmail should be coming from some datasource like sharepoint record or datavererse or so on.
You can get current record and then it's property requestorEmail convert it to Text using Text function.
you could also try ThisItem.requestorEmail and with text function you can do so.
Ms Docs should help
In addition if you could show/add code for your requestorEmail data card, I can try to provide exact function to extract email. but above info should lead you in correct direciton
I used on change action of the datacard and used set global variable varUserEmail to thisitem.requestoremail . Then i set the button visible if the user email = varUserEmail.Email . So in this way everytime the email changes to the email that is supposed to edit the request the buttons are visible for editing or deleting the report.
On creation of new external user from ATG BCC, I need to include some logic like encrypting password and sending email to user. Achieved this functionality by extending GSAPropertyDescriptor class and overriding its getPropertyValue(RepositoryItemImpl pItem, Object pValue) method.
Problem is, this method is getting called only when we click on create button from "General" tab present in users section, but not on click of same create button from other tabs like "Commerce", "Orgs & Roles", "User Segments" and "Advanced".
Please suggest!!
It is not a good idea to override getPropertyValue of an item for this implementation. The right way to do this is to work with the formhandler that is responsible for saving the user. It is a bit tricky to find this formhandler. It will be in the atg/web/viewmapping/ViewMappingRepository/ of the BCC instance. In this repository there will be lots of formhandlers configured for different purposes. You have to pick the one relevant for the user edit. Here is an example of what you might find there:
With this, you go to appropriate Formhanlder, like /atg/web/assetmanager/editor/profile/UserFormHandler mentioned here. And override that component in your module with your own implementation. Once that is done, you'll have the control of the action. You can do your work and pass on the control to super class (the original implementation).
Regards,
Jags
Can anyone tell me , how can i change Confirmation email text in rails 4.
I want to send custom text for confirmation when i use "conformable" in rails with devise
Right now email sent is below
Welcome user email here.
You can confirm your account email through the link below:
Confirm my account
Thanks
It's pretty straightforward and Devise has great documentation here which you can reference if you get stuck: Custom Mailers on Devise
Here's the summarized step-by-step:
Create a custom mailer class. You will put this code in your /lib directory. In you /lib directory, create a file called lib/my_mailer.rb and copy the code there. You will then need to require this new class and you can do this at the top of initializer/devise.rb.
lib/my_mailer.rb
class MyMailer < Devise::Mailer
helper :application # gives access to all helpers defined within `application_helper`.
include Devise::Controllers::UrlHelpers # Optional. eg. `confirmation_url`
end
And then in config/initializers/devise.rb
require 'my_mailer'
Devise.setup do |config|
.
.
.
end
The next step is to update the devise mailer setting to point to my_mailer
config/initializers/devise.rb
config.mailer = 'MyMailer'
The last step is to copy the devise mailer views from the Devise gem into a new views folder directly in your app. So inside the Devise gem you are going to go to app/views/mailer and copy the three files from there and paste them into a new directory in your App. You will need to name this new directory in your app as follows app/views/my_mailer/
From there you can directly edit the mailers to your liking.
Hope this helps!
How do you go about changing the title of emails in a second language store view. Example "New Order" in the New Order confirmation email. csv files are not responding in this case...
Another solution. You can copy the default email templates into a language folder you are wanting to use, and translate them manually.
Copy everything in app/locale/en_US/template to app/locale/[YOUR
LANGUAGE CODE]/template.
Change [YOUR LANGUAGE CODE] to the Language Code of your
desired language. YOu can find a list here. Make sure it's in
the format en_US.
Modify the email templates in your app/locale/[YOUR
LANGUAGE CODE]/template folder.
In Magento, go to System > Configuration > General. At the top left, change your Current Configuration Scope: to the store you want translated.
Change the Locale to the language you translated to. It must match correct the language code used in your folder namespace.
NOTE: When editing the email template files, you'll notice some comments at the top containing variables and such. You will see something like <!--#subject Welcome, {{var customer.name}}! #-->. Changing this will alter the subject line used by Magento.
You can just create custom Transactional Emails which include the translations needed for the store view.
Create a new Transaction Email template, in your store's required
language. Go to System > Transactional Emails and click Add New
Template. Load in the default template you are trying to
translate and modify the subject and body of the email.
Go to System > Configuration > Sales Emails At the top left of your configuration, change to your desired Store View you want these emails to be assigned to.
Change the New Order Confirmation Template to the Transaction Email template you created. Click Save Config.
Items ordered from that store should now send an email using the translated email you created.
I'm using Drupal 6.16: When a user creates an account on my site I have them select a category (ie children, youth, adult, etc). This is done with the select list box using the content_profile module. I have a content type that posts an announcement. In this content type is a check box that says 'email group'. Right now it does nothing, but what I would like for it to do is e-mail all the users that are associated with the group they chose when signing up for their account. If this will require extra code please be specific as I am not a strong php programmer.
Thanks for the help!!
msindle
There might be some module that do it exactly, but I don't think so.
I would have done it using few building blocks:
Retrieve the list of emails using Views - define a view that gives you the addresses according to a given group argument.
Use Rules module that will send an email notification after node is created.
Combine the two (this is the hard part) - insert the values from the view as the recipients for the email. You might be able to do it using PHP inside the Rule definition, plus view execution.
Try to accomplish it, and if you get into troubles, you are welcome to contact me via shushu.i#gmail.com
I would try http://drupal.org/project/subscriptions module + http://drupal.org/project/messaging module. You can set preferences for automatic subscribing to content type. Maybe Rules module can subscribe users automatically after creating or updating content_profile. Or maybe Rules can flag users after creating or updating content_profile and Subscription module could autosubscribe flagged users.