Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

How Do I Assign An Email Template To My Custom Form Rate Topic   - - - - -

 
  • eweig
  • Member
  • Trial users
  • Join Date: 30-Jan 18
  • 43 posts

Posted 06 April 2019 - 12:38 AM #1

I created a custom form.  Everything works fine.  On submit, it sends me an email with all the form values and responses.   From the look of it, it is using the email template labeled "Contact form".  I want to create my own email template and assign the custom form to use that one.   I created the email template, but I can't find how to assign my custom form to use the new email template.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19158 posts

Posted 08 April 2019 - 06:19 AM #2

Email template with the form_builder_form is added on Form builder addon installation. Corresponding data can be checked in the following file (check the email_templates section)

 

app/addons/form_builder/addon.xml

 

Template is used in the app/addons/form_builder/func.php file

 

http://prntscr.com/n8wzrj

 

So create new template and use new template_code for specific page IDs


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • eweig
  • Member
  • Trial users
  • Join Date: 30-Jan 18
  • 43 posts

Posted 09 May 2019 - 02:09 PM #3

Thank you that was very helpful.  

 

I have another question, I need to be able to display who is sending the form.  It is only available to those that have access to admin.   The problem is that when they are submitting the form, form builder does not pickup who is logged in.  

 

In the func.php file under the addon form_builder (in the function fn_send_form), I am adding:

print_r(Tygh::$app['session']['auth']); 

The user is logged in the "admin" side, but form builder is redirecting to the root an the results are:

Array
(
    [area] => C
    [user_id] => 0
    [user_type] => C
    [tax_exempt] => N
    [last_login] => 0
    [order_ids] => Array
        (
        )

    [password_change_timestamp] => 0
    [is_root] => N
    [usergroup_ids] => Array
        (
            [0] => 0
            [1] => 1
        )

    [act_as_user] => 
    [this_login] => 1557409279
    [referer] => https://www.mysite.com/admings5972.php?dispatch=order_management.add
    [ip] => 71.15.114.45
)

You can see the session is not giving me who is logged in the admin side that submitted the form.

 

How do I get this session data in the form_builder addon?

Attached Thumbnails

  • form_builder_code.PNG
  • form_builder_result_array.PNG


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19158 posts

Posted 13 May 2019 - 05:10 AM #4

Different sessions are used in the store-front and back-end. So you should log in the store-front using admin account at first


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.