Tokyoj

Topic: How to add a BCC option to Apply Online

Thanks to Chronos, Putypuruty this works.
I thought BCC would allow applicants to keep a record of the application if they want, without add a Candidate Control Panel.

To give the applicant the option of being BCC'd on the application do this:

Step 1. Add a field and corresponding label for the email address. (I didn't use form validation but can if you want/need to) and then name the field my_email or whatever you want.

Example:
<td><label for="my_email">Your email:</label></td>

<td>
<input {if $smarty.session.apply_errors.apply_email}class="error"{/if} type="text" name="my_email" id="my_email" maxlength="60" size="30" value="{$smarty.session.apply_fields.my_email}" />

<span class="validation-error">{if $smarty.session.apply_errors.my_email}<img src="{$BASE_URL}img/icon-delete.png" alt="" />{/if}</span>   

<span>If you want to be BCC'd please enter your email address here. </span>
</td>

Step 2. Add the my_email string as a BCC to class.Postman.php. Below it's added as the 4th entry.

Example:
// Send online application to employer
     public function MailApplyOnline($data)
    {
        $extra = '\n\n---\nThis email is from' . $_SERVER['HTTP_REFERER'] . 'from YOURSITENAME.';
        $mail = new PHPMailer();
        $mail->From = $data['my_email'];
        $mail->AddBCC($data['my_email']);
        $mail->FromName = $data['apply_name'];                   
    $mail->Body = str_replace(array('\r\n', '\r', '\n'), '<br />', $data['apply_msg'] . $extra);
    $mail->AltBody = $data['apply_msg'] . $extra;
        $mail->Subject = "[" . SITE_NAME . "]'" . $data['job_title'] . "'application";
    $mail->AddAddress($data['company_email'], $data['company_name']);
    }

This code my differ from yours somewhat but the syntax and process works. Just edit it to suit your needs. If you have any problems, please post.

---------------
Tokyoj
"You can't build a reputation on what you're going to do." (Henry Ford)
"Insanity is doing the same thing over and over, expecting different results." (Albert Einstein)

hobo

Re: How to add a BCC option to Apply Online

Hi, I applied this mod and it works great.
Now, this unfortunately reveals the address of job poster to anyone who applies for the job, which is bad I guess.
Is there a way to replace job poster e-mail with something like noreply@mydomain.com?