function invite_by_email_enable in Invite 7.4
Implements hook_enable().
File
- modules/
invite_by_email/ invite_by_email.install, line 18 - Install, update and uninstall functions for the Invite by e-mail.
Code
function invite_by_email_enable() {
//@codingStandardsIgnoreLine.
variable_set('invite_default_mail_body', t(<<<TEMPLATE
[invite:inviter:name] has invited you to join [site:name] at [site:url].
To become a member of [site:name], click the link below or paste it into the address bar of your browser.
[invite:invite-accept-link]
TEMPLATE
));
variable_set('invite_default_mail_subject', t('[invite:inviter:name] has sent you an invite!'));
$types = array(
array(
'type' => 'invite_by_email',
'module' => 'invite_by_email',
'invite_sending_controller' => array(
'invite_by_email' => 'invite_by_email',
),
'label' => st('Invite by e-mail'),
'description' => st('Invitation by e-mail.'),
),
);
foreach ($types as $type) {
$invite_by_email = entity_load('invite_type', FALSE, array(
'type' => 'invite_by_email',
));
if (empty($invite_by_email)) {
$invite_type = entity_create('invite_type', $type);
if ($invite_type) {
$invite_type->invite_sending_controller = $type['invite_sending_controller'];
invite_type_save($invite_type);
}
}
}
}