Questions tagged [emails]
Drupal core uses email for a number of important tasks, such as verifying authenticated users' email address.
1,399
questions
50
votes
4
answers
47k
views
How to programmatically send an email?
I'd like to use Drupal's email system to programmatically send an email from my custom module. Is that possible?
32
votes
4
answers
53k
views
How to use drupal_mail() to send emails with custom template
I would like to use the drupal_mail() function to send out emails but with a custom HTML template so that they are in keeping with my website design but I am a complete newbie to hooks and modules etc....
29
votes
14
answers
18k
views
How can I stop Drupal from sending e-mails of any kind?
I have a dev, staging, and live server workflow set up on Pantheon. My site has a lot of rules that cause members to be e-mailed for various reasons. I sometimes need to work on these on my dev/...
25
votes
5
answers
40k
views
How to send HTML email
I am creating a simple module which will be sending HTML emails to users for deals in our website.
I have searched a lot, but I can't find a solution proper solution for Drupal. Now I can send mails ...
20
votes
5
answers
15k
views
BCC For drupal mail function [closed]
I am using Drupal 7 and focused to work with email option. I am using the Forward module. How can I add the BCC field in the drupal_mail() function.
my default function having,
drupal_mail('forward'...
17
votes
4
answers
28k
views
Adding extra fields to Site Contact Form
This seems strangely difficult to me. What I thought would just be a case of adding extra fields a bit like adding fields to Content Types. But no. I can't locate any facility to add say a phone ...
15
votes
7
answers
15k
views
Which newsletter module will fit my requirements?
I'm trying to implement a newsletter for my users to subscribe to and I'm noticing that there are a lot of different newsletter modules out there. I'm was looking for one that will easily allow me to:
...
15
votes
3
answers
25k
views
Send attachments with drupal_mail
I'm trying to send attachments with my email from Drupal. In my custom module i have added:
class SponsorprogramMailSystem implements MailSystemInterface {
/**
* Concatenate and wrap the e-mail ...
14
votes
3
answers
12k
views
Theme a contact form
I'd like to theme a contact form in Drupal 8.
I'd like to put divs around form elements (using bootstrap).
I also want to put some classes on certain elements (submit button, the form itself).
14
votes
3
answers
16k
views
Set the "from" header in the email to be in the format "Full Name" <[email protected]>
How can I change the from header in the email sent from Drupal to be in the format "Fullname" <[email protected]>?
I managed to do it on a Drupal 6 site at one point in the past, but I no ...
11
votes
3
answers
16k
views
Administrator notification on user registration
Administrator is not notified when a user registers on my D7 site, while the registrants do receive a message. On the D6 version of the site it worked. Here's the setup:
Drupal 7.10
User registration ...
11
votes
3
answers
13k
views
How to actually set a maxlength for textarea field in contact form
I need to limit the textarea message of the core module contact form to a certain number of characters.
Here are the facts
The Form API does not allow one to set a maxlength on textarea field types [...
11
votes
5
answers
2k
views
How can I allow users to receive e-mails whenever I update my blog in Drupal 7?
I have a blog in English and Japanese in Drupal 7. I created this blog using a custom content type and Views, not the built-in blog module.
I have an RSS feed (made in Views) for each language. I ...
10
votes
3
answers
2k
views
restrict user from certain role to change their email
Is there any way I can restrict users from certain role to change their email address. Once they are registered I need them no to be able to change it in the edit settings page. I found how to ...
10
votes
2
answers
1k
views
Notifications for anonymous users on nodes
I am looking for a module or some kind of workaround e.g. involving Rules, that will allow anonymous users to subscribe to new comments on nodes they have created. My user scenario is as follows:
An ...
9
votes
3
answers
21k
views
How to set 'html' email template for webform email setting?
Is there any way to use html email for e-mail template in webform email setting?
In my webform node I go to: node/113/webform/emails/1 to change the setting but I don't see any 'html' option. Look my ...
9
votes
4
answers
16k
views
How to send email to multiple recipients using drupal_mail?
I am using drupal_mail to send email,
$to = '[email protected]';
drupal_mail('$module_name', $key, $to, language_default(), $params = array('username' => 'Tanvir'), $from = NULL, $send = TRUE);
I ...
9
votes
3
answers
7k
views
Email a Whole Node (Including template contents)
I have created my own custom node.tpl.php file.
I now want to email the entire node, each time the user creates a new node of that content type (I have made sure that all the HTML in my node.tpl.php ...
9
votes
10
answers
13k
views
Unable to send e-mail. Contact the site administrator if the problem persists
When my web form is filled and submitted, I get redirected to a page that says:
Thank you for submitting.
but theres a red warning box there that says:
Unable to send e-mail. Contact the site ...
9
votes
3
answers
32k
views
How to use [submission:values] in Email template in Webforms
I have the Webform 7.x-4.0-alpha6 version module enabled.
I have a Webform node with 20 form components. I added one email in Email Setting and I created the email template where I used the token: [...
9
votes
3
answers
7k
views
Easiest way to test email notifications locally?
I am making a forum website with email notifications. I need to test these email notifications locally. Ive only ever used MAMP so I dont have much experience setting up dev environments.
What's the ...
9
votes
1
answer
4k
views
Allowing users to use the same email
I am working on a system that will be used at least partially by students some of which will likely be grade schoolers. The old system that we are replacing with a Drupal site would allow mass ...
9
votes
3
answers
10k
views
How do you add a PDF attachment to an email?
Goal: I need to send an email with a pdf attachment in Drupal 8.
Progress
I am able to send an email with subject and message but have never been able to get the attachment. When I turn on the logic ...
8
votes
5
answers
7k
views
How can I remove preview button from contact form?
How to turn off preview in contact form in Drupal 8.1.x
8
votes
3
answers
2k
views
How do I allow regular non-admin users to view other users' emails?
Email is now an included field in core, but the stock email for users seems to be set to private; only users with administrator privileges or the user themselves can see.
I'd like to allow other ...
8
votes
1
answer
6k
views
How to programmatically render a contact form in a theme in D8
How to get the side-wide contact form (feedback) individually displayed in a custom block or other page then /contact (e.g. frontpage)?
I've tried this code, but it is not working (are contact forms ...
7
votes
4
answers
10k
views
drupal_mail() strips all html tags from emails
So as the title explains, when sending an HTML email with drupal_mail(), email comes with no HTML tags.
$module = 'module';
$key = 'contact_message';
$language = language_default();
$...
7
votes
1
answer
5k
views
"user:one-time-login-url" token not getting replaced by token_replace
I'm trying to send e-mails to users manually by using the hook_mail_alter hook. The following is my function in its entirety:
function custom_module_mail_alter(&$message) {
$email = '[user:...
7
votes
4
answers
2k
views
How can I send email to user that is not logged in since 30 days?
I am using Drupal 7, and I want to send email to registered users who have not logged in to the site since 30 days; for example, an email saying:
Hello user, you are not login since 30 days.
Is ...
7
votes
3
answers
844
views
Use email to validate post, not unlike craigslist
I'd like for anonymous users to be able to post nodes to my site. By default their post is unpublished, but when they submit it, the site sends an email with a verification URL. When they revisit the ...
7
votes
2
answers
2k
views
Why do I have to enter a recipient after selecting users in the VBO send emails operation?
I'm using VBO module in D7. I created a table view listing users by some filter criteria. I want to send a mass mail to selected users. I'm using the VBO field bulk operations: user and selected the ...
7
votes
1
answer
4k
views
Do we need PHPMailer?
We are building our website in Drupal 7. However, I wonder whether we need to configure and setup the PHPMailer module.
We are designing an ecommerce website that will send an email upon ...
7
votes
5
answers
529
views
How to ask anonymous to confirm their flag by email?
I need to add Flags to one of my content types. Two kinds, actually:
I'll take care of it
Solved
Second flag should be available only to node author, and only if first one was already raised. But ...
7
votes
1
answer
772
views
How to theme simplenews unsubscribe page?
I'am trying to theme Unsubscribe Page for my Newsletter to much the Newsletter Design.
Does anyone know how to theme unsubscribe page in Drupal 6:
example.com/newsletter/confirm/remove/*
6
votes
7
answers
11k
views
How to place Contact form in block?
I have to embed a contact form inside of a block, and I'm trying to use the entity.form_builder service, But I'm not sure which entity I should give it, I found Message and ContactForm entity, so what ...
6
votes
6
answers
10k
views
How can I disable all outgoing emails from a site all at once?
There are some automated outgoing emails from my Drupal site like by core system mail, ubercart, webform and Rules.
The reason is that I also have a test site which is exactly the copy of the ...
6
votes
1
answer
5k
views
Multilanguage mails
We have built a site with multi language support in English and German languages. Now we need to set drupal default mails like login reg. mails, forget password mails in both the languages. The users ...
6
votes
2
answers
6k
views
HTML mail without using modules
I am trying to use the MailManager class in Drupal 8 to send HTML mail. I got it working, but it isn't parsing the HTML markup. I think something is wrong with the headers of the email.
What I have ...
6
votes
1
answer
4k
views
Adding check boxes to contact form
I am attempting to make a contact form in Drupal 8 using "Contact forms" included in core. I'm struggling to figure out how to really customize it, like adding radio buttons or check boxes - does ...
6
votes
4
answers
12k
views
Send mail with attachment using the MIME Mail module
I am not able to send mails with an attachement using the MIME Mail module.
There isn't munch documentation about this module, but some people claim they have successfully used the module, and sent a ...
6
votes
1
answer
9k
views
Drupal 7 webform module is not sending email properly
I have this modules enabled in my Drupal 7 site:
Mail System v7.x-2.34
Mime Mail v7.x-1.0-alpha2
Smtp Authentication v7.x-1.0
Webform v7.x-3.19
I have configured Mail system to "format" mails with ...
6
votes
1
answer
190
views
Let users access account before confirming email address
I'd like to let users access their account without confirming email address. But still send the email confirmation. Then I'll display a message saying that if email is not confirmed within 3 days, ...
6
votes
3
answers
5k
views
How to add a field to the contact form in Drupal 7?
I want to add a phone field and a company field to the contact form. How to overwrite the form in template.php? Thank you
6
votes
1
answer
4k
views
Add attachments to mail
How I send a mail with attachments using the mimemail module? In drupal 6 it was using the function:
mimemail($sender, $recipient, $subject, $body, $plaintext = NULL, $headers = array(), $text = NULL,...
6
votes
1
answer
1k
views
How to send mails to users with bulk operations in drupal7
I want to select some users from a view with the field VBO , and to send to this users an email which cotaining a subject and a body. How can I proceed?
Thanks for the response.
I'm a new user of ...
6
votes
1
answer
3k
views
Send email with attachment
I want to send an attachment with drupal_mail() using hook_mail_alter(). Do you have any ideas about which parameter should I use?
Does the variable $param help, in some way?
5
votes
5
answers
10k
views
Redirect contact form on submit
Using Drupal 8 and trying to get the contact form to redirect to the same page after submitting. By default it seem to redirect to the home page.
I have edited my themename.theme file
function ...
5
votes
5
answers
11k
views
How to set type="email" attribute on a Drupal form textfield
I'm doing some mobile forms with Drupal and have an email address textfield that currently has type="text" in the resulting HTML. I'd like this to be type="email" instead so that iOS shows a more ...
5
votes
6
answers
13k
views
How can I theme the outgoing contact mail?
I want to theme the outgoing mail from the contact module, because the standard output looks horrible. Where can I do this? It's the one starting with admin (http://example.com/user/1) sent a message ...
5
votes
2
answers
4k
views
How do I set BCC in the email I am sending?
I am using Drupal 8. How can I add the BCC field in the mail function.
Using below code Bcc not working
$params['body'] = 'test body';
$params['subject'] = 'test subject';
$params['Bcc'] = 'test@...