Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function createScheduleNotification(){
- $from = 'info@careervita.com';
- $fromName = 'info';
- $to = 'testcareervita@outlook.com';
- $subject = 'Invitation for Test Demo';
- $desc = 'THIS IS TEST DEMO INVITAION';
- $uid = date('Ymd').'T'.date('His')."-".rand();
- $message = "BEGIN:VCALENDARrn";
- $message.= "PRODID:-//Zoho CRM//NONSGML Calendar//ENrn";
- $message.= "VERSION:2.0rn";
- $message.= "X-WR-TIMEZONE:GMTrn";
- $message.= "X-WR-CALNAME:ZCRMrn";
- $message.= "METHOD:REQUESTrn";
- $message.= "CALSCALE:GREGORIANrn";
- $message.= "BEGIN:VEVENTrn";
- $message.= "UID:".$uid."rn";
- $message.= "DESCRIPTION:".$desc."rn";
- $message.= "ORGANIZER;CN= Manisha:mailto:manisha.g@careervita.comrn";
- $message.= "DTSTART:20150710T100010Zrn";
- $message.= "DTEND:20150710T110000Zrn";
- $message.= "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Vinod T:mailto:g_manisha@outlook.comrn";
- $message.= "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;CN=Vivek J:mailto:manisha.gaidhane8788@gmail.comrn";
- $message.= "LOCATION:CV360rn";
- $message.= "CREATED:20150701T060720Zrn";
- $message.= "LAST-MODIFIED:20150701T060720Zrn";
- $message.= "X-EVENT-OWNER:1563791000000084003rn";
- $message.= "END:VEVENTrn";
- $message.= "END:VCALENDAR";
- Yii::import('application.extensions.phpmailer.JPhpMailer');
- $mailer = new JPhpMailer(true);
- if (Yum::module()->phpmailer['transport'])
- switch (Yum::module()->phpmailer['transport']){
- case 'smtp':
- $mailer->IsSMTP();
- break;
- case 'sendmail':
- $mailer->IsSendmail();
- break;
- case 'qmail':
- $mailer->IsQmail();
- break;
- case 'mail':
- default:
- $mailer->IsMail();
- }
- else
- $mailer->IsMail();
- $mailer->IsHTML(true);
- $mailerconf=Yum::module()->phpmailer['properties'];
- if(is_array($mailerconf))
- foreach($mailerconf as $key=>$value) {
- if(isset(JPhpMailer::${$key}))
- JPhpMailer::${$key} = $value;
- else
- $mailer->$key=$value;
- }
- $mailer->SetFrom($from);
- $mailer->AddAddress($to);
- $mailer->Subject = $subject;
- $mailer->Body = $message;
- $mailer->AltBody = $body;
- $mailer->AddCC('testcareervita@gmail.com', 'Person One');
- $mailer->AddCC('testcareervita@yahoo.in', 'Person Two');
- $mailer->ContentType = 'text/calendar';
- $mailer->CharSet = 'UTF-8';
- $mailer->addCustomHeader("MIME-version : 1.0");
- $mailer->addCustomHeader('Content-type : text/calendar; name="testcal.ics"; method=REQUEST;');
- $mailer->addCustomHeader('Content-Transfer-Encoding:7bit'); //to interpret ics file
- $mailer->addCustomHeader("Content-class: urn:content-classes:calendarmessage");
- $mailer->addCustomHeader('Content-Disposition : inline; filename="testcal.ics"');
- return $mailer->Send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement