changing the getDnsTxtSpfRecordToAdd()

João Reis

Member
I want to change some things in getDnsTxtSpfRecordToAdd(), how can I change it without editing SendingDomain.php, is it possible?

Thanks.
 
That method has a hook into it which you can use to alter the returned value ;)

At line 387 you have
PHP:
// since 1.3.5.9
$record = Yii::app()->hooks->applyFilters('sending_domain_get_dns_txt_spf_record', $record, $this, $smtpHosts);

This means, you can hook into it from a theme/extension or by creating apps/init-custom.php with a content like:
PHP:
<?php
Yii::app()->hooks->addFilter('sending_domain_get_dns_txt_spf_record', function($record, $sendingDomain, $smtpHosts){
    return 'YOUR SPF RECORD NAME HERE';
});

Oh boy, you have to love these things : >
 
Back
Top