WebsiteBaker Community Forum

WebsiteBaker Support (2.12.x) => Modules => Topic started by: astricia on April 05, 2019, 10:12:05 AM

Title: Email subject in Miniform
Post by: astricia on April 05, 2019, 10:12:05 AM
Hi all (especially Ruud),

is it somehow possible to add the content of a certain field in Miniform to the subject of the Email that is sent out?

For a client website I have an inquiry form that has a field "product" - and for each product page, I have the link to the form with the "?product=...", so that this certain field gets already filled in by clicking on the link. The client now requested that the name of the product is already in the SUBJECT of the email being sent to him, not only in the body, so it is easier for him to sort through these inquiries.

Is this somehow possible? (WB 2.12.1 / Miniform 0.14)

Thanks,
Astrid
Title: Re: Email subject in Miniform
Post by: dbs on April 08, 2019, 09:31:43 AM
Hi, i'm also interested. Want use a droplet 'groupname' in the subject.
Title: Re: Email subject in Miniform
Post by: dbs on April 08, 2019, 10:05:04 AM
One way could be: put your wished content in a session variable.
Code: [Select]
$_SESSION['miniform']['group'] = $wb->get_group_name();
Put this to $subject in view.php line 49 (in my case the session variable is unnecessary).
Code: [Select]
$subject = $settings['subject'].' '. $wb->get_group_name();
Title: Re: Email subject in Miniform
Post by: astricia on April 10, 2019, 09:01:39 AM
Hmm... can you explain a little more in detail? The subject should be taken from a certain FIELD (input textfield) from the form. I don't understand where I define this session variable? In a droplet? In the view.php? In the form? Please explain....

Thanks,
Astrid
Title: Re: Email subject in Miniform
Post by: astricia on April 15, 2019, 09:03:42 AM
*push*

Still searching for a solution here - can somebody help, please??? :-D
Title: Re: Email subject in Miniform
Post by: dbs on April 17, 2019, 10:57:25 AM
Ich versuch es mal, die beste Lösung wird es nicht sein.

Leg dir unter/über Miniform einen neuen Abschnitt Code2(PHP) an.
Code: [Select]
// Versuch den Inhalt eines Feldes in den Emailbetreff zu bekommen
$_SESSION['name'] = $_SESSION['form']['mf_r_name'];
$_SESSION['name'] hier ist name frei wählbar.
$_SESSION['form']['mf_r_name'] hier ist das richtige Feld einzutragen, so wie es im Formular steht.

Erweitere die view.php z49 von
Code: [Select]
$subject = $settings['subject'];zu
Code: [Select]
$subject = $settings['subject'] . ' - ' . $_SESSION['name'];
Title: Re: Email subject in Miniform
Post by: astricia on April 17, 2019, 11:25:48 AM
Jaaaa... funktoniert!!! Danke! :-D
Title: Re: Email subject in Miniform
Post by: dbs on May 28, 2019, 12:15:40 PM
I believe this in code2
Code: [Select]
// Versuch den Inhalt eines Feldes in den Emailbetreff zu bekommen
$_SESSION['name'] = $_SESSION['form']['mf_r_name'];
add a entry in the errorlog.

This works without errorlog entry.
Code: [Select]
$_SESSION['name'] = $_SESSION['mf_r_name'];