\Cairn_Email

Email helper functions for Cairn payment processing

Summary

Methods
Properties
Constants
contact_info()
email()
secure_email()
secure_email_to()
ajax_contact()
mail_from()
mail_from_name()
encrypt_shipping_info()
process_invoice_email()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

contact_info()

contact_info() : array

Gets the contact information from the options database.

Returns

array —
  • email string The shipping contact email address
  • email_public_key string The email GPG public key
  • email_public_key_id string The email GPG public key ID
  • address1 string The origin address line 1
  • address2 string The origin address line 2
  • city string The origin city
  • state string The origin state/province
  • zip string The origin zip code
  • country string The country where the items ship
  • sip_phone string Session Initiated Protocal address
  • pots_phone string Plain old telephone system number
  • name string Name of the shipping contact

email()

email(string $subject, string $message) : boolean

Sends an email to the shipping contact

Parameters

string $subject

The subject of the email.

string $message

The body and message of the email.

Returns

boolean —

If the email was processed without any errors

secure_email()

secure_email(string $subject, string $message) : boolean

Sends an encrypted email to the shipping contact

Parameters

string $subject

The subject of the email.

string $message

The body and message of the email.

Returns

boolean —

If the email was processed without any errors

secure_email_to()

secure_email_to(string $email, string $publickey, string $subject, string $message) : boolean

Sends an encrypted email to an email address.

Parameters

string $email

The recipient email address.

string $publickey

The recipient email public keiy.

string $subject

The subject of the email.

string $message

The body and message of the email.

Returns

boolean —

If the email was processed without any errors

ajax_contact()

ajax_contact()

AJAX callback to send an email to the shipping contact. Prints JSON object with the status of the email with the following attributes:

  • success boolean If the email was processed without errors.
  • message string The message to display to the user.

mail_from()

mail_from(string $email_address)

Callback to set the from email address header of outgoing email.

Parameters

string $email_address

The existing email address.

mail_from_name()

mail_from_name(string $from_name)

Callback to set the from name header of outgoing email.

Parameters

string $from_name

The existing email name.

encrypt_shipping_info()

encrypt_shipping_info(string $cart, string $request, string $publickey) : string

Encrypts the shipping information into an encrypted string.

Parameters

string $cart

A cart array return by Cairn_Post_Set::cart

string $request

The posted request variables sent from the order form.

string $publickey

The shipping contact public key.

Returns

string —

The shipping information encrypted.

process_invoice_email()

process_invoice_email(string $cart, string $request)

Sends an email to the customer to notify about the recent order on hold.

Parameters

string $cart

A cart array return by Cairn_Post_Set::cart

string $request

The posted request variables sent from the order form.