Got it working
PHP Code:
$pmbody = construct_phrase($vbphrase['sendpm_on_paid_promotion_primary_alertpm'], $promotion['username'], $promotion['title']);
$pmdm = datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
$pmdm->set_info('is_automated', true);
$pmdm->set('fromuserid', $vbulletin->options['sendpm_on_promotion_fromuserid']);
$pmdm->set('fromusername', $vbulletin->options['sendpm_on_promotion_fromusername']);
$pmdm->set_info('receipt', false);
$pmdm->set_info('savecopy', false);
$pmdm->set('title', $vbulletin->options['sendpm_on_promotion_pm_subject']);
$pmdm->set('message', $pmbody);
$pmdm->set_recipients($promotion['username'], $pmpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->set('allowsmilie', true);
($hook = vBulletinHook::fetch_hook('private_insertpm_process')) ? eval($hook) : false;
$pmdm->pre_save();
if (empty($pmdm->errors))
{
$pmdm->save();
($hook = vBulletinHook::fetch_hook('private_insertpm_complete')) ? eval($hook) : false;
}
unset($pmdm);