• Resolved guiberlin

    (@guiberlin)


    Hi there,

    thank you for the great plugin first of all ??

    I’ve been fighting for a few hours now and don’t manage to get what I’d like to achieve.

    Basically I would like to have the name and the email of the uploader in the “From” notification email (that way, we automatically create a ticket in our ticket system).

    In the notifiyheaders it works but only with a “fix” name and email:

    notifyheaders=”From: Bob <[email protected]> is ok

    notifyheaders=”From: %userdata3% <%userdata4%> All seems fine, no error message BUT I never get the notification email.

    I tried all the combination I could think of but without success so far.

    My %userdata4% is the email adress and I know it works. If I use it in the email recipient field, it is sent to the email entered by the uploader in the form.

    I’d be really thankful for some help ??

    Guillaume

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author nickboss

    (@nickboss)

    Hi,

    Are you trying to put variables inside the headers? Unfortunately this is not supported. However you can do it with a hook. Here it is how:

    1. Go to plugin’s section in Dashboard, in Hooks tab and add a new hook.
    2. Give it any title you want.
    3. Put the following code in the Code box:

    
    if (!function_exists('wfu_before_email_notification_handler')) {
    	function wfu_before_email_notification_handler($changable_data, $additional_data) {
    		$changable_data["headers"] = "From: ".$changable_data["user_data"][2]["value"]." <".$changable_data["user_data"][3]["value"].">";
    		return $changable_data;
    	}
    	add_filter('wfu_before_email_notification', 'wfu_before_email_notification_handler', 10, 2); 
    }
    

    4. Set Status to Active and Save.

    You are done (hopefully).

    If you do not have the Pro version that supports hooks, simply put the code at the end of your functions.php file.

    Regards

    Nickolas

    Thread Starter guiberlin

    (@guiberlin)

    Hi Nickolas,

    it worked perfectly!

    Thank you very much for the fast and excellent support.

    I just bought the pro version.

    Have a lovely day.

    Guillaume

    I was just going to ask about this when I saw the answer here. Thanks from me too!

    We bought the Pro Version, and I just tried to creating a hook with the code above. But I am getting the following error:

    Hook has been saved but cannot be activated because the code contains errors. Please check its syntax.

    My data fields are different, the Name is %userdata1% and the Email is %userdata2%, so I changed the reference numbers in the code based on that (see below) but I am still getting that error. Any idea what might be causing it? Thanks.

    if (!function_exists('wfu_before_email_notification_handler')) {
    	function wfu_before_email_notification_handler($changable_data, $additional_data) {
    		$changable_data["headers"] = "From: ".$changable_data["user_data"][1]["value"]." <".$changable_data["user_data"][2]["value"].">";
    		return $changable_data;
    	}
    	add_filter('wfu_before_email_notification', 'wfu_before_email_notification_handler', 10, 2); 
    }
    Plugin Author nickboss

    (@nickboss)

    Hi, I think the code is Ok. The problem is that the security settings of your website do not allow the plugin to check the code for errors.

    Please go to Settings and activate option “ModSecurity Restrictions”. This will make the hook work.

    Nickolas

    Hello need a help on this
    I have implemented same in the function.php but still that finction doenot get call

    Plugin Author nickboss

    (@nickboss)

    Hi, can you please send me the code?

    @nickboss thank for your response

    Now i have just solved it out

    Thank you.:-)

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘notifyheaders Sender Name / Filter From:’ is closed to new replies.