Reputation: 14578
I want a user registration process where the email sent to the user at various conditions (e.g. registration, approval) also contains some attachments depending on user profile.
Which file in Drupal core should I modify to configure the subject, body and add the attachment in an email based on user profile?
I add a custom module for this? If yes, then which hook am I looking for?
Upvotes: 0
Views: 844
Reputation: 420
In your module you will need
hook_form_alter()
to enter your own submission handler in #submit array in the $form array of the specified form (or unset the one that is executed... copy it and make your own) and in that handler you could use
hook_mail()
to form your own email with the values submitted from the form contained in $form_state array, or anything else!
Upvotes: 0
Reputation: 25312
Modifying drupal core is really a bad idea; you can simply create your own module, and use hook_mail().
Upvotes: 1