Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

cc and bcc on replies

2»

Comments

  • Just finished a email CC mod

    I just finished a MOD that adds in a field emailcc to the ticket object and ticket table in the db.

    It works together with pipe and ticket create function to take ALL other emails in TO or CC field and stores it in a comma delimited list in the ticket table.

    I also have added to the staff and user view the ability to edit that list in ticket view.

    It sends all additional emails as a CC when replying out.

    Hopefully I can pull out those mods and post it.... have some other critical ones I need to finish.
  • Hi,

    I have done as outlined in the steps above (except the last step, becuase I don't have $headers="MIME-Version: 1.0\n" . line in the class.ticket.php). My version is 1.6 latest release. I have CC and BCC fields in ticket view, but when I enter the CC and BCC addresses there are no emails going to those respective emails.
    Please help me!!!

    Thanks
  • This mod won't work with RC5. In RC5 the mail function and how it is called within osticket is completely different.
  • jpowers,

    Do you have any suggestions for this...

    I'm trying to get the system to automatically bcc a subscribed list with every outgoing email. I've tried adding bcc into headers in several places but nothing seems to be working. I don't need any fields or anything I simply need ALL tickets to get bcc'd to an extra static email address.
  • Let us know when a fix is found. THe first page should be updated with a note that it doesn't work with RC5. I did all the steps, then after the fact found that it's not supported. Oh well. Thanks for your help @jpowers40828
  • cc and bcc on replies

    i have looked them up, as far as the ones they are showing appear to be real but then again, im not an expert and they can show anything they want.....
  • I did eventually find a fix and its been working ever since. I'll find my entries on Monday when i get back to the office and I'll post them here.
  • This is what I have as far as BCC, however, I expect it will not be what a number of people are wanting as it is set statically.

    include/class.email.php

    Find:
    $subject=stripslashes(preg_replace(\"/(\r\n|\r|\n)/s\",'', trim($subject)));
    $body = stripslashes(preg_replace(\"/(\r\n|\r)/s\", \"\n\", trim($message)));


    and above that add:
    $Bcc=\"email_address@example.com\";


    This is working for me because I have a mailing list setup that has anyone that receives osTickets in email form will then also get this BCC email.
  • scottro;11170 said:
    This is what I have as far as BCC, however, I expect it will not be what a number of people are wanting as it is set statically.

    include/class.email.php

    Find:
    $subject=stripslashes(preg_replace(\"/(\r\n|\r|\n)/s\",'', trim($subject)));
    $body = stripslashes(preg_replace(\"/(\r\n|\r)/s\", \"\n\", trim($message)));


    and above that add:
    $Bcc=\"email_address@example.com\";


    This is working for me because I have a mailing list setup that has anyone that receives osTickets in email form will then also get this BCC email.
    NOTE: The solution employed below was for an RC of OSTicket. In Release 1.6, the lines searched for are, in fact in /include/class.email.php. - RSL (edit on 24 March 2010)
    Hi,

    I searched for the lines
    $subject=stripslashes(preg_replace(\"/(\r\n|\r|\n)/s\",'', trim($subject)));
    $body = stripslashes(preg_replace(\"/(\r\n|\r)/s\", \"\n\", trim($message)));

    in /include/class.email.php but they were not there. I believe you meant in class.misc.php.

    In any case, I wound up doing this a bit differently as adding the $bcc= line didn't do the trick. I simply added a line below
    $to=preg_replace(\"/(\r\n|\r|\n)/s\",'', trim($to));


    like this:


    $to.=\",my_tech_support_email@example.com\";


    While this solution does expose the address on the 'to' line of the mail, that's ok with me for this implementation as it's the alias for our support group.

    Thanks for the pointers...hope this helps someone out there too.

    -Ray
  • Disabling autoresponses when CC mails are received

    Please assist,

    My boss requires that autoresponses be disabled for all mails that come in when [email]support@xxxxxxxx.com[/email] is carbon Copied.

    Regards,

    Humphrey
    jpowers40828;4950 said:
    For RC4

    In include/staff/viewticket.inc.php ~ line 305 AFTER

                            <div style=\"margin-top: 3px;\">
    <label for=\"ticket_status\"><b>Ticket Status:</b></label>
    <?
    $checked=isset($info['ticket_status'])?'checked':''; //Staff must explicitly check the box to change status..
    if($ticket->isOpen()){?>
    <input type=\"checkbox\" name=\"ticket_status\" value=\"Close\" <?=$checked?> > Close on Reply
    <?}else{ ?>
    <input type=\"checkbox\" name=\"ticket_status\" value=\"Reopen\" <?=$checked?> > Reopen on Reply
    <?}?>
    </div>


    ADD

                            <div>
    <label for=\"carbon_copy\"><b>Cc:</b></label>
    <input type=\"text\" name=\"carbon_copy\" value=\"<?=$cc?>\" />
    <label for=\"blind_carbon_copy\"><b>Bcc:</b></label>
    <input type=\"text\" name=\"blind_carbon_copy\" value=\"<?=$bcc?>\" />
    </div>



    Then in scp/tickets.php ~ line 75 CHANGE

                //If no error...do the do.
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment']))){


    TO

    			$cc = strip_tags($_POST['carbon_copy']);
    $bcc = strip_tags($_POST['blind_carbon_copy']);
    //If no error...do the do.
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment'],true,$cc,$bcc))){



    Then in include/class.ticket.php ~ line 561 CHANGE

        function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true){



    TO

        function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true,$cc,$bcc){



    Then in include/class.ticket.php ~ line 613 AFTER

                    break;
    endswitch;
    $body = str_replace(\"%signature\",$signature,$body);


    ADD

    			$headers=\"\";
    if($cc) $headers.=\"Cc: \".$cc.\"\r\n\";
    if($bcc) $headers.=\"Bcc: \".$bcc.\"\r\n\";


    Then in include/class.ticket.php ~ line 620 CHANGE

                        $headers=\"MIME-Version: 1.0\n\" .


    TO

                        $headers.=\"MIME-Version: 1.0\n\" .
  • a question

    seeing how this is a cc and bcc thread i thought i would give this question a shot.

    scenario: we have a customer that sends from a helpdesk (distribution list) thus the auto response is sent to the list which is fine, but New Messages which are sent from individuals don't populate the existing ticket thread, it opens a new one. is there way to make that happen?
  • in RC5 BCC and CC?
    jpowers40828;9467 said:
    This mod won't work with RC5. In RC5 the mail function and how it is called within osticket is completely different.
    Hi Jpowers,
    I congratulate for you work!

    I installed version RC5, and unfortunately, this module does not work in my system :D
    Do you already have an idea or solution for it?

    thank you
  • Hello all, my company is just getting started switching over to OSticket.

    We installed OSticket a while back to demo it and make sure it was going to work for what we needed it to do. I could have sworn seeing a CC and BCC field already built into OSticket. Did this feature get stripped out in 1.6?
  • I don't think it was present in 1.5, I had to add it myself. For mine I just hard coded in a BCC to the ticket distro email address. I haven't really looked at 1.6 yet though, I'm waiting for the next big release to update again.
  • jpowers40828;4950 said:
    For RC4

    In include/staff/viewticket.inc.php ~ line 305 AFTER

                            <div style=\"margin-top: 3px;\">
    <label for=\"ticket_status\"><b>Ticket Status:</b></label>
    <?
    $checked=isset($info['ticket_status'])?'checked':''; //Staff must explicitly check the box to change status..
    if($ticket->isOpen()){?>
    <input type=\"checkbox\" name=\"ticket_status\" value=\"Close\" <?=$checked?> > Close on Reply
    <?}else{ ?>
    <input type=\"checkbox\" name=\"ticket_status\" value=\"Reopen\" <?=$checked?> > Reopen on Reply
    <?}?>
    </div>


    ADD

                            <div>
    <label for=\"carbon_copy\"><b>Cc:</b></label>
    <input type=\"text\" name=\"carbon_copy\" value=\"<?=$cc?>\" />
    <label for=\"blind_carbon_copy\"><b>Bcc:</b></label>
    <input type=\"text\" name=\"blind_carbon_copy\" value=\"<?=$bcc?>\" />
    </div>



    Then in scp/tickets.php ~ line 75 CHANGE

                //If no error...do the do.
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment']))){


    TO

    			$cc = strip_tags($_POST['carbon_copy']);
    $bcc = strip_tags($_POST['blind_carbon_copy']);
    //If no error...do the do.
    if(!$errors && ($respId=$ticket->postResponse($_POST['msg_id'],$_POST['response'],$_POST['signature'],$_FILES['attachment'],true,$cc,$bcc))){



    Then in include/class.ticket.php ~ line 561 CHANGE

        function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true){



    TO

        function postResponse($msgid,$response,$signature='none',$attachment=false,$canalert=true,$cc,$bcc){



    Then in include/class.ticket.php ~ line 613 AFTER

                    break;
    endswitch;
    $body = str_replace(\"%signature\",$signature,$body);


    ADD

    			$headers=\"\";
    if($cc) $headers.=\"Cc: \".$cc.\"\r\n\";
    if($bcc) $headers.=\"Bcc: \".$bcc.\"\r\n\";


    Then in include/class.ticket.php ~ line 620 CHANGE

                        $headers=\"MIME-Version: 1.0\n\" .


    TO

                        $headers.=\"MIME-Version: 1.0\n\" .

    look goods.. my company ask me to add cc in a new ticket which is email only reply to [email]noreply@xxx.com[/email] where all staff can get it. they ask me to add cc to send email for a certain staff to follow up the problem. any idea with it? :confused::confused::confused:
  • profshah;21003 said:
    look goods.. my company ask me to add cc in a new ticket which is email only reply to [email]noreply@xxx.com[/email] where all staff can get it. they ask me to add cc to send email for a certain staff to follow up the problem. any idea with it? :confused::confused::confused:
    Is this what you are looking for?

    http://sudobash.net/?p=234
  • scottro;21016 said:
    Is this what you are looking for?

    http://sudobash.net/?p=234
    I try this before but it occur an error when I want test it. It work on Post Reply but not in New Ticket. Previous programmer already put the cc at Post Reply but now I need work on put at the New Ticket when the staff want cc to certain people.

    Attach a file for reference
    preview_new_ticket.jpg
    263 x 280 - 9K
  • Hi all,

    I have installed version 1.6.0 stable, and unfortunately, this module does not work in my system.
    Does somebody already have an idea or solution for it?
  • Cc Bcc: no e-mails received
    jpowers40828;6886 said:
    On the last step you put the add lines inside the } instead of after it.
    Hello,

    I have done the above steps but unfortunately the e-mails to cc: and bcc: were not delivered as they should.

    Also i couldn't find the last step the text $headers="MIME-Version: 1.0\n" , any idea in the mentioned file?
  • I think I got it.

    Saw this bug on pear.php.net
    that steered me in the right direction.

    First follow scottro's tutorial here.

    create an array in class.email.php right before this statement.

    if($smtp){ //Send via SMTP
    $mail = mail::factory('smtp',
    array ('host' => $smtp['host'],
    'port' => $smtp['port'],
    'auth' => $smtp['auth']?true:false,
    'username' => $smtp['username'],
    'password' => $smtp['password'],
    'timeout' =>20,
    'debug' => false,
    ));


    like so:

    $smtp_to = array (

    'To' => $to,

    'Cc'=> $cc,

    'Bcc' => $bcc;


    Then replace;

    $result = $mail->send($to, $headers, $body);
    if(!PEAR::isError($result))
    return true;


    with

    $result = $mail->send($smtp_to, $headers, $body);
    if(!PEAR::isError($result))
    return true;



    If you followed all of scottro's steps plus mine you should now be able to send cc and bcc emails when replying to a ticket when using smtp.

    Just make sure to not make a bcc header if you want it to ne a true blind carbon copy.
  • CC

    Hello,
    Can you please send me the 3 working files for cc?
    Regards,
    Rugwiza

    jpowers40828;6878 said:
    can you send me the 3 files mentioned above?

    [email]jpowers40828@gmail.com[/email]
  • Hello,
    does this work with the last version of osticket 1.7 ?

    Best regards
    Amorino
  • Available in v1.7.0?

    Hello,
    I just installed osTicket v1.7.0 in a test environment. Has anybody developed this mod for this version of osTicket?

    Thanks!:D
  • Hello,
    I need it too ;)

    Regards ;)
  • It has not been updated for 1.7ST at this time, hence why this thread is in the 1.6ST section of the forums.
  • Hi ,

    For which version this mod is for , am using 1.8.0.2  ,  i cant find the codes u mentioned here in the osticket 1.8.0.2 version . can you guide me on this .


    Regards,
    RK
  • It has not been updated for 1.7ST at this time, hence why this thread is in the 1.6ST section of the forums.
                                                                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sign In or Register to comment.