Author Topic: Email subject in Miniform  (Read 268 times)

Offline astricia

  • Posts: 627
  • Gender: Female
    • netSchmiede24
Email subject in Miniform
« 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

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Email subject in Miniform
« Reply #1 on: April 08, 2019, 09:31:43 AM »
Hi, i'm also interested. Want use a droplet 'groupname' in the subject.

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Email subject in Miniform
« Reply #2 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();

Offline astricia

  • Posts: 627
  • Gender: Female
    • netSchmiede24
Re: Email subject in Miniform
« Reply #3 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

Offline astricia

  • Posts: 627
  • Gender: Female
    • netSchmiede24
Re: Email subject in Miniform
« Reply #4 on: April 15, 2019, 09:03:42 AM »
*push*

Still searching for a solution here - can somebody help, please??? :-D

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Email subject in Miniform
« Reply #5 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'];
« Last Edit: April 17, 2019, 11:03:09 AM by dbs »

Offline astricia

  • Posts: 627
  • Gender: Female
    • netSchmiede24
Re: Email subject in Miniform
« Reply #6 on: April 17, 2019, 11:25:48 AM »
Jaaaa... funktoniert!!! Danke! :-D

Offline dbs

  • Betatester
  • **
  • Posts: 7920
  • Gender: Male
  • tioz4ever
    • WebsiteBaker - jQuery-Plugins - Module - Droplets - Tests
Re: Email subject in Miniform
« Reply #7 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'];

 

postern-length