Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 199

Drupal core uses email for a number of important tasks, such as verifying authenticated users' email address.

1 vote

Removing username from personal contact form

The email that is send in those cases is set by contact_mail(), which is hook_mail() implementation done from the Contact module, and that contains the following code: switch ($key) { case 'pag …
avpaderno's user avatar
  • 97.9k
3 votes

How to send 2 mails simultaneously with drupal_mail()

An example of this hook implementation is contact_mail(), which handles the emails sent from the Contact module in contact_personal_form_submit(), and contact_site_form_submit(). // contact_site_form_submit …
avpaderno's user avatar
  • 97.9k
0 votes

Empty e-mail body using drupal_mail

The reason you are getting an empty string for body is that Drupal is expecting an array, not a string. In fact, the function that formats the message, DefaultMailSystem::format(), contains the follow …
avpaderno's user avatar
  • 97.9k
1 vote
Accepted

Message not being sent in the body of the mail

The body of the message is set by the implementation of hook_mail() done from the module sending the message. The code invoking that hook is the following one. (See MailManager::doMail(), the method c …
avpaderno's user avatar
  • 97.9k
4 votes
Accepted

How can I add HTML links in e-mails?

That is expected, when the Drupal mail back-end that comes with Drupal, implemented by the PhpMail class, is used. In fact, its format() method contains the following code. // Join the body array in …
avpaderno's user avatar
  • 97.9k
2 votes
Accepted

Send mail to users including receiver's username

language))), $language->language); $message['body'][] = t('Message:', NULL, $language->language); $message['body'][] = $params['message']; break; Other modules can change the content for the sent emails
avpaderno's user avatar
  • 97.9k
2 votes
Accepted

Does Drupal's theme('table') works in email body?

You can read drupal_mail() in HTML for how to output HTML in an email sent with drupal_mail(). As you are outputting links, I will add a note about that. By default l() outputs relative links that o …
avpaderno's user avatar
  • 97.9k
3 votes
Accepted

How can I prevent users from entering invalid e-mail addresses at registration?

Drupal validates the email since Drupal 5; since Drupal 7, valid_email_address() (the function used to validate the email entered during registration, or when editing a user account) calls filter_var( …
avpaderno's user avatar
  • 97.9k
2 votes
Accepted

Hook to log results of calls to drupal_mail() made by other modules?

The only way I can see is implementing hook_watchdog(), and look for a error message that matches "Error sending e-mail (from %from to %to)." function mymodule_watchdog(array $log_entry) { if ($lo …
avpaderno's user avatar
  • 97.9k
2 votes

Body and Subject fields in Mail Function

The last parameter you are passing to drupal_mail() is FALSE. That parameter is telling the function if sending the mail. The documentation describes the parameter as follows: $send: If TRUE, drup …
avpaderno's user avatar
  • 97.9k
1 vote
Accepted

Allow anonymous users to load site contact form without granting admin privileges

The Access Denied error is returned because the following code executed by code_site_form(). (Notice the call to drupal_access_denied().) $limit = variable_get('contact_threshold_limit', 5); $win …
avpaderno's user avatar
  • 97.9k
1 vote

With the Simplenews module, how can I use a custom mytheme/node--type.tpl.php with emails?

You cannot, since the Simplenews module is using the simplenews-newsletter-body.tpl.php template file (this file, in case you are using Drupal 6). The Drupal 7 template file is described as follows: …
avpaderno's user avatar
  • 97.9k
4 votes
Accepted

Anonymous users can't use personal contact forms

Assuming that the anonymous users are not trying to access user/0/contact (which would not be an ordinary case), the reasons why they cannot access the contact for a an authenticated user A are essent …
avpaderno's user avatar
  • 97.9k
2 votes

Is it possible to abort sending of the e-mail somewhere in the middle of sending procedure?

As reported in the documentation for hook_mail_alter(), you can avoid a message is sent by setting $message['send'] to FALSE. Parameters $message: An array containing the message data. Ke …
avpaderno's user avatar
  • 97.9k
2 votes

identify author of an entity

EntityInterface doesn't have any method for getting the user who created an entity because not all the entities have the concept of owner. For example, the User entity is one of those entities. The en …
avpaderno's user avatar
  • 97.9k

15 30 50 per page