M
M
Mikhail Ivanov2018-06-26 15:52:02
WordPress
Mikhail Ivanov, 2018-06-26 15:52:02

After submitting the form, send a link to the mail?

Hello, the problem is this, there is a regular form, name, phone number, e-mail. After submitting the form, you need to send a link to download the pdf document to the e-mail that the person wrote, tell me how to do this, maybe there are examples or links to the article, I’ll tell Google right away, but I didn’t find anything similar

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Yanchevsky, 2018-06-26
@mishaweb

Well, since the form is self-written, then try adding something like this to the handler:

$to = $_POST['your_email']; //подставить название поля, которое указано у Вас в форме
$subject = 'Ссылка на файл'; //тема письма
$body = '<a href="/wp-content/uploads/file.pdf"></a>'; //заменить на свою ссылку
$headers = array('Content-Type: text/html; charset=UTF-8');
 
wp_mail( $to, $subject, $body, $headers );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question