Version 4.3.6

This commit is contained in:
Neo committed 2025-12-19 05:49:12 -08:00
1 parent fe1acf984a
commit 1a0c7fd3c2
609 files changed
+14707 -5726

No files matched your search

@@ -121,9 +121,18 @@ class _Bulkmailer extends \IPS\Patterns\ActiveRecord
$content = str_replace( $k, '*|' . str_replace( array( '{', '}' ), '', $k ) . '|*', $content );
}
}
/* Format content */
$content = \IPS\Email::staticParseTextForEmail( $content, \IPS\Lang::load( \IPS\Lang::defaultLanguage() ) );
foreach( array_keys( static::getTags() ) as $k )
{
$content = str_replace( '%7B' . mb_substr( $k, 1, -1 ) . '%7D', '*|' . mb_substr( $k, 1, -1 ) . '|*', $content );
$content = str_replace( '*%7' . mb_substr( $k, 1, -1 ) . '%7C*', '*|' . mb_substr( $k, 1, -1 ) . '|*', $content );
}
/* Send it */
$email = \IPS\Email::buildFromContent( $this->_data['subject'], \IPS\Email::staticParseTextForEmail( $content, \IPS\Lang::load( \IPS\Lang::defaultLanguage() ) ), NULL, \IPS\Email::TYPE_BULK )
$email = \IPS\Email::buildFromContent( $this->_data['subject'], $content, NULL, \IPS\Email::TYPE_BULK )
->setUnsubscribe( 'core', 'unsubscribeBulk' );
$sent = 0;
foreach ( $recipients as $languageId => $_recipients )
@@ -158,7 +167,7 @@ class _Bulkmailer extends \IPS\Patterns\ActiveRecord
* @return \IPS\Db\Select
*/
public function getQuery( $option=NULL )
{
{
/* Compile where */
$where = array();
$where[] = array( "core_members.allow_admin_mails=1" );
@@ -175,19 +184,14 @@ class _Bulkmailer extends \IPS\Patterns\ActiveRecord
{
if( $_where = $extension->getQueryWhereClause( $this->_options[ $key ] ) )
{
if ( is_string( $_where ) )
{
$_where = array( $_where );
}
$where = array_merge( $where, $_where );
$where[] = $_where;
}
}
}
}
/* Compile query */
$select = ( $option !== static::GET_COUNT_ONLY ) ? 'core_members.member_id AS my_member_id, core_members.*' : 'COUNT(DISTINCT member_id)';
$select = ( $option !== static::GET_COUNT_ONLY ) ? 'core_members.member_id AS my_member_id, core_members.*' : 'COUNT(DISTINCT core_members.member_id)';
$limit = is_array( $option ) ? $option : NULL;
$query = \IPS\Db::i()->select( $select, 'core_members', $where, ( $option !== static::GET_COUNT_ONLY ) ? 'core_members.member_id' : NULL, $limit, NULL, NULL, \IPS\Db::SELECT_DISTINCT );