1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Form Email Plugin

Discussion in 'Community' started by stevelis, Jul 14, 2019.

Thread Status:
Not open for further replies.
  1. stevelis

    stevelis Member

    Level: Community
    Is it possible to insert the current date into the message text box of this plugin and have it formatted just for the year.
     
  2. wuschel_lux

    wuschel_lux Member

    Level: Community
    hi, the complete timestamp can be done with:
    PHP:
    {mysql_date}
    Now how to limit it on just the year? Maybe someone else can give you a better answer.
     
    stevelis likes this.
  3. stevelis

    stevelis Member

    Level: Community
    thanks wuschel_lux
    Yes the {MySQL_date} worked and displayed the full time stamp.
    I had a few minutes to spare before work at the formatting (current year only, 2019) but none were successful so far.
    Will keep trying and welcome any formatting suggestions.
    Steve
     
  4. startpoint

    startpoint Active Member

    Level: Community
    PHP:
    $date = '{mysql_date}';
    $year = explode("-",$date)[0];
    return $year;
     
    stevelis likes this.
  5. lousyfool

    lousyfool Active Member

    Level: Community
    stevelis likes this.
  6. stevelis

    stevelis Member

    Level: Community
    Thanks for the suggestions but I am not sure whether this can be achieved in the Email Form Plugin, Options tab > Message Text box.
    Note: the {mysql_date} placeholder does insert the full timestamp. Not sure what code will split the year from the timestamp in the message box.
    Here is the part of text using the element placeholders and where I am trying to insert the 'year' part of the timestamp.

    <div><span style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><strong>{calendar___Event}</strong> being conducted at<strong> {calendar___Location}</strong></span>
    </div>
    <div><span style="font-family: arial,helvetica,sans-serif; font-size: 12pt;">and commencing on the<strong> {calendar___StartDate} </strong>and finishing on the<strong> {calendar___enddate},
    $date = '{mysql_date}'; $year = explode("-",$date) [0]; return $year; </strong></span>
    </div>

    Steve
     
  7. troester

    troester Well-Known Member Staff Member

    Level: Community
    stevelis likes this.
  8. stevelis

    stevelis Member

    Level: Community
    Hi troester
    I have manually added 2019 into the message for the time being whilst I work on a PHP template as you have suggested.
    Steve
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    If you just want the current year, {year} should work.

    -- hugh
     
Thread Status:
Not open for further replies.

Share This Page