Forum Replies Created

Viewing 15 posts - 16 through 30 (of 79 total)
  • Author
    Posts
  • in reply to: Email #7459
    lawrencepepper
    Participant

    OK,

    I have it working but not sure why this happens.

    In the form settings if I change the mail type to global instead of PHP (mail) it works.

    My global default is PHP mail.

    So there you go…

    L

    in reply to: Email #7458
    lawrencepepper
    Participant

    Hello Ally,

    I tried your suggestion but it still does not work.

    If I remove the code and use the static email field set in the form settings the email sends. As soon as I place the code listed above with your suggestion in the functions page it no longer works.

    Code I am using:


    function mytheme_modify_recipients($mailer, $form, $attachments)
    {

    if (is_user_logged_in()) {
    global $current_user;
    get_currentuserinfo();
    $person = $current_user->user_login;
    }

    $con = mysql_connect("localhost","user","password");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("time", $con);

    $result = mysql_query("SELECT * FROM employee WHERE user_name = '$person'");

    while($row = mysql_fetch_array($result))

    $mailer->AddAddress($row['supervisor_email']);

    return $mailer;
    }
    add_filter('iphorm_pre_send_notification_email_5', 'mytheme_modify_recipients', 10, 3);

    in reply to: Email #7440
    lawrencepepper
    Participant

    Also,

    I would like to set the “From ” address as well, how can I incorporate that into the code above as well?

    L

    in reply to: Email #7438
    lawrencepepper
    Participant

    OK,

    Figured out the error, I needed a ; at the end of the last line. Oops!

    BUT,

    The form is not emailing anything now. When submitted it says the form has been sent but nothing shows in email.

    Is $mailer the proper field? I want the recipient of this form to be the ‘supervisor_email’ that I am getting form the query.

    L

    in reply to: Email #7436
    lawrencepepper
    Participant

    Tried this:


    #Set Approval Email

    function mytheme_modify_recipients($mailer, $form, $attachments)
    {

    if (is_user_logged_in()) {
    global $current_user;
    get_currentuserinfo();
    $person = $current_user->user_login;
    }

    $con = mysql_connect("localhost","user","password");
    if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }

    mysql_select_db("time", $con);

    $result = mysql_query("SELECT * FROM employee WHERE user_name = '$person'");

    while($row = mysql_fetch_array($result))

    $mailer = $row['supervisor_email'];

    return $mailer;
    }
    add_filter('iphorm_pre_send_notification_email_7', 'mytheme_modify_recipients', 10, 3)

    Still getting errors.

    L

    in reply to: Email #7435
    lawrencepepper
    Participant

    See below….

    in reply to: White Space #7316
    lawrencepepper
    Participant

    Figured this out.

    Just use [raw][/raw] tags around the insertion code.

    Fixed.

    L

    in reply to: Email #7315
    lawrencepepper
    Participant

    What I would like to do is have a hidden form field on the form with an email address in it. This email would be the address that the form data goes to.

    This way I could dynamically populate the hidden field with whatever email address I need.

    L

    in reply to: Email #7314
    lawrencepepper
    Participant

    I am having the same sort of problem with another form.

    I need the recipient of the email being generated to be a dynamic variable.

    How can this be done.

    L

    in reply to: Re-Direct #7297
    lawrencepepper
    Participant

    Got it all working.

    Thanks!

    L

    in reply to: Re-Direct #7293
    lawrencepepper
    Participant

    Oops!

    I see….

    did not change all values in the second $end line…

    L

    in reply to: Re-Direct #7292
    lawrencepepper
    Participant

    Something is now working right:

    The second date being passed keeps coming up:

    2013-2-02

    No matter what I pick in the date picker on the form page.

    The first always comes correct.

    My code is:


    $start = $_SESSION['iphorm_4']['iphorm_4_1'];
    $start = $start['year'] . '-' . $start['month'] . '-' . $start['day'];

    $end = $_SESSION['iphorm_4']['iphorm_4_2'];
    $end = $end['year'] . '-' . $start['month'] . '-' . $start['day'];

    The start date always passes correctly but the end date keeps coming up 2013-02-12 no matter what I pick in the date picker on the form page.

    my code in the functions.php file is:


    function submit_range($form)
    {
    $_SESSION['iphorm_4'] = $form->getValues();
    }
    add_action('iphorm_post_process_4', 'submit_range');

    in reply to: Re-Direct #7291
    lawrencepepper
    Participant

    Thanks Ally!

    How can I have the day default to have a 0 in front of it is it is 9 or below:

    2013-11-04

    right now it is coming out

    2013-11-4

    L

    in reply to: Re-Direct #7280
    lawrencepepper
    Participant

    Please forgive me but my PHP is not all that great, could you give me some direction on how to do that or point me to an example on the web?

    Just searched stack overflow but nothing really comes up for my example….

    Thanks

    L

    in reply to: Re-Direct #7278
    lawrencepepper
    Participant

    Well,

    I found another way but still stuck.

    I am using the following code to set session variables:


    function submit_range($form)
    {
    $_SESSION['iphorm_4'] = $form->getValues();
    }
    add_action('iphorm_post_process_4', 'submit_range');

    I am passing a start date and an end date.

    Then on the redirected page I am trying to run a query selecting data from my database between a date range using those two dates passed by the form.

    On the reirected page I am setting the variables passed as so:

    $start = $_SESSION[‘iphorm_4’][‘iphorm_4_1’];
    $end = $_SESSION[‘iphorm_4’][‘iphorm_4_2’];

    Then running a query using them as so:

    WHERE date BETWEEN ‘$start’ AND ‘$end’

    But this does not work.

    Any help?

    L

Viewing 15 posts - 16 through 30 (of 79 total)
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy