Welcome to Geeklog, Anonymous Saturday, December 03 2022 @ 10:45 am EST

Geeklog Forums

Adding a Disclaimer on every email generated from geeklog


Status: offline

Aerocream

Forum User
Newbie
Registered: 12/29/05
Posts: 10
Location:Naples, FL
I have a client who is running a geeklog site for a local campaign. Every Page has the footer with the disclaimer on it but also every email sent from the site has to have the disclaimer aswell. Almost like a Signature. Anyone ever tackle a request like this ? Thanks in Advance.
http://www.aerocream.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The welcome email (after signup) is configurable.

If you really want the signature in every email, you could simply hack function COM_mail (in lib-common.php) and hard-code it there.

bye, Dirk
 Quote

Status: offline

Aerocream

Forum User
Newbie
Registered: 12/29/05
Posts: 10
Location:Naples, FL
Okay Dirk so I'm rusty on my PHP. Can ya help me out here ? I'm going to define the disclaimer in a varible and then add it to the $message ?


Text Formatted Code

/**
* Send an email.
*
* All emails sent by Geeklog are sent through this function now.
*
* @param    to         string   recipients name and email address
* @param    subject    string   subject of the email
* @param    message    string   the text of the email
* @param    from       string   (optional) sender of the the email
* @param    html       bool     true if to be sent as an HTML email
* @param    priority   int      add X-Priority header, if > 0
* @return   boolean             true if successful,  otherwise false
*
*/
function COM_mail( $to, $subject, $message, $from = '', $html = false, $priority = 0 )
{
    global $_CONF, $LANG_CHARSET;

    static $mailobj;

    if( empty( $from ))
    {
        $from = COM_formatEmailAddress( $_CONF['site_name'], $_CONF['site_mail']);
    }

    $to = substr( $to, 0, strcspn( $to, "rn" ));
    $from = substr( $from, 0, strcspn( $from, "rn" ));
    $subject = substr( $subject, 0, strcspn( $subject, "rn" ));

    if( function_exists( 'CUSTOM_mail' ))
    {
        return CUSTOM_mail( $to, $subject, $message, $from, $html, $priority );
    }

    include_once( 'Mail.php' );
    include_once( 'Mail/RFC822.php' );

    $method = $_CONF['mail_settings']['backend'];

    if( !isset( $mailobj ))
    {
        if(( $method == 'sendmail' ) || ( $method == 'smtp' ))
        {
            $mailobj =& Mail::factory( $method, $_CONF['mail_settings'] );
        }
        else
        {
            $method = 'mail';
            $mailobj =& Mail::factory( $method );
        }
    }

    if( empty( $LANG_CHARSET ))
    {
        $charset = $_CONF['default_charset'];
        if( empty( $charset ))
        {
            $charset = 'iso-8859-1';
        }
    }
    else
    {
        $charset = $LANG_CHARSET;
    }

    $headers = array();

    $headers['From'] = $from;
    if( $method != 'mail' )
    {
        $headers['To'] = $to;
    }
    $headers['Date'] = date( 'r' ); // RFC822 formatted date
    if( $method == 'smtp' )
    {
        list( $usec, $sec ) = explode( ' ', microtime());
        $m = substr( $usec, 2, 5 );
        $headers['Message-Id'] = '<' .  date( 'YmdHis' ) . '.' . $m
                               . '@' . $_CONF['mail_settings']['host'] . '>';
    }
    if( $html )
    {
        $headers['Content-Type'] = 'text/html; charset=' . $charset;
        $headers['Content-Transfer-Encoding'] = '8bit';
    }
    else
    {
        $headers['Content-Type'] = 'text/plain; charset=' . $charset;
    }
    $headers['Subject'] = $subject;
    if( $priority > 0 )
    {
        $headers['X-Priority'] = $priority;
    }
    $headers['X-Mailer'] = 'GeekLog ' . VERSION;

    $retval = $mailobj->send( $to, $headers, $message );
    if( $retval !== true )
    {
        COM_errorLog( $retval->toString(), 1 );
    }

    return( $retval === true ? true : false );
}

 

http://www.aerocream.com
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Something like
Text Formatted Code
$message .= "Your message here";
$retval = $mailobj->send( $to, $headers, $message );
 

bye, Dirk
 Quote

All times are EST. The time is now 10:45 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content