[Added HTML email templating support Tijmen de Mes **20120809102022 Ignore-this: 7e2d40739eed6f7f717f4e622b001f2c ] hunk ./library/sip_settings.php 7086 - if (!$tpl && !$skip_html) { + if (!$tpl && !$skip_html) { hunk ./library/sip_settings.php 7088 - print _("Error: no email template found"); + print _("Error: no email template found"); hunk ./library/sip_settings.php 7093 + $tpl_html = $this->getEmailTemplateHTML($this->reseller, $this->Preferences['language']); + + if (!$tpl_html && !$skip_html) { + print "

"; + print _("Error: no HTML email template found"); + print ""; + } + hunk ./library/sip_settings.php 7113 - $body = $smarty->fetch($tpl); + $bodyt = $smarty->fetch($tpl); + + if ($tpl_html) { + $bodyhtml = $smarty->fetch($tpl_html); + } + + include 'Mail.php'; + include 'Mail/mime.php' ; + + $hdrs = array( + 'From' => $this->support_email, + 'Subject' => $subject + ); + + $crlf = "\n"; + $mime = new Mail_mime($crlf); + + $mime->setTXTBody($bodyt); + + if ($tpl_html) { + $mime->setHTMLBody($bodyhtml); + } + + $body = $mime->get(); + $hdrs = $mime->headers($hdrs); + + $mail =& Mail::factory('mail'); hunk ./library/sip_settings.php 7141 - if (mail($this->email, $subject, $body, "From: $this->support_email") && !$skip_html) { + $mail->send($this->billing_email, $hdrs, $body); + + if ($mail->send($this->email, $hdrs, $body) && !$skip_html) { hunk ./library/sip_settings.php 7679 + function getEmailTemplateHTML($language='en') { + $file = "sip_settings_email_$language.html.tpl"; + $file2 = "sip_settings_email.html.tpl"; + + //print("templates_path = $this->templates_path"); + + if (file_exists("$this->templates_path/$this->reseller/$file")) { + return "$this->templates_path/$this->reseller/$file"; + } elseif (file_exists("$this->templates_path/$this->reseller/$file2")) { + return "$this->templates_path/$this->reseller/$file2"; + } elseif (file_exists("$this->templates_path/default/$file")) { + return "$this->templates_path/default/$file"; + } elseif (file_exists("$this->templates_path/default/$file2")) { + return "$this->templates_path/default/$file2"; + } else { + return false; + } + } + addfile ./templates/default/sip_settings_email.html.tpl hunk ./templates/default/sip_settings_email.html.tpl 1 + + + + + hunk ./templates/default/sip_settings_email.html.tpl 7 +{literal} + +{/literal} + + + + +
+
+ + + + +
+

+ Dear {$client->name}, +

+ +

+ Make acquaintance with your new SIP account. SIP stands for Session + Initiation Protocol and is becoming the universal way to communicate using + software phones, desktop telephones or dual-mode WiFi phones. +

+

+ Your SIP address is {$client->account} +

+ +

+ You may use this address in combination with a SIP device. +

+ +

+ You can use your SIP account for Voice and Video over IP, IM or Presence + free of charge providing you have access to the Internet. Depending on + your account settings you may also be able to place and receive calls + to the public telephone network, redirect Internet calls to your mobile + phone or receive voicemail by email. +

+

+ How to use your SIP account: +

+
    +
  1. You may use a SIP hardware phone + or download X-lite, a free software phone for + Windows, MacOSX or Linux from: + X-lite +
  2. + +
  3. Setup your SIP device as follows: + + + + + + + + + + + + + + + + + + + + + + + + {if $client->xcap_root} + + + + + + + + + + + + + {/if} +
    + Username + + {$client->username} +
    + Password + + {$client->password} +
    + Domain/Realm + + {$client->domain} +
    + Register with domain + + yes +
    + Outbound Proxy + + {$client->sip_proxy} +
    + Presence Mode + + Presence agent +
    + Storage Policy + + XCAP +
    + XCAP Root + + {$client->xcap_root} +
    +
  4. +
+ + {foreach name=enums from=$client->enums item=enum} +

ENUM number {$smarty.foreach.enums.iteration}: {$enum}

+ {/foreach} + + {foreach name=aliases from=$client->aliases item=alias} +

Alias {$smarty.foreach.aliases.iteration}: {$alias}

+ {/foreach} + {if $client->voicemailMailbox} +

Your voicemail is delivered by e-mail to {$client->email}

+ {/if} + {if $client->allowPSTN} +

You may call to PSTN

+ {/if} +

+ To access your account settings go to {$client->sip_settings_page}
+ Your login details: +

+

+
+ {if $client->web_password} + Password: {$client->web_password} + {else} + Password: {$client->password} + {/if} +

+

+ How to use your SIP account: +

+
    +
  • To test, call 3333, you should hear some music playing
  • +
  • To call someone, type in the called SIP address (name@domain.com) and enter
  • +
  • To call ENUM enabled numbers use + or * and then the full ENUM number
  • +
  • To change your privacy settings dial {$client->changePrivacyAccessNumber}, to check privacy status dial {$client->checkPrivacyAccessNumber}
  • + {if $client->voicemailMailbox} +
  • To access your voicemail messages or mailbox settings dial {$client->voicemailAccessNumber}
  • + {/if} + {if $client->cdrtool_address} +
  • To access your Call Detail Records go to: {$client->cdrtool_address}
  • + {/if} +
+ {if $client->support_web} +

For more information visit {$client->support_web}

+ {/if} +
+
+
+
+ +