dersven
December 5, 2017, 11:41am
1
hi.
i try to integrate a simply mail form. it runs already. its fine.
controllers--contact.php
<?php
return function($site, $pages, $page) {
$alert = null;
if(get('submit')) {
$data = array(
'name' => get('name'),
This file has been truncated. show original
snippets--contactmail.php
Hey,
a new contact request has been submitted!
----
Name: <?php echo $name ?>
----
Email: <?php echo $email ?>
This file has been truncated. show original
templates--contact.php
<?php snippet('header') ?>
<main class="main" role="main">
<h1><?php echo $page->title()->html() ?></h1>
<form method="post">
<?php if($alert): ?>
<div class="alert">
This file has been truncated. show original
now i would add the name from the input form. but i didnt understand the code ;(
i tried to use the line 31. of controllers/contact.php
'from' => 'no-reply@*************',
and write some stuff like these:
'from' => $data['name'].$data['email'],
but how can i combine name and mail?
Try this:
'from' => $data['name'].' <'.$data['email'].'>' ,
thanks for the idea.
the name will appear in the mail. yes. but in this way: name @ server-mail-configuration - unfortunately not the email address from the field email, its the mail-server-config.
its a bit tricky to put an second term to the first part. i have to build the ‘send-mail’ in an other way?
I’m afraid I don’t quite get what you are trying to tell me?