EMail Subject

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4430
    mubi
    Participant

      Hi Olly,
      how can I change the email subject. I need a command for my printer in subject at start.(cmd: print lp1)
      Thanks for your kind help

      #4431
      Olly
      Admin & Mod

        stupidly (or to be precise: mainly because no-one has asked for it before i think) it’s not as simple as it should be really .

        give me a few hours and i’ll add a filter to the plugin that will let you do that much more easily than hacking around or extending classes etc etc.

        i’ll post code here ….

        #4432
        mubi
        Participant

          I know the value of your help. It is so nice of you. Thanks very much.

          #4449
          Olly
          Admin & Mod

            Hi,

            as I want to add some more things to the next update it might take a few days more to make this available.
            in the meantime you can do the following

            in wppizza/classes/wppizza.send-order-emails.inc.php AFTER

            
            $this->subjectSuffix 	=	''.$this->orderTimestamp.'';
            

            (at approx line 30) ADD the following

            
            /**make subject filterable**/
            $this->subjectPrefix = apply_filters('wppizza_filter_email_subject_prefix', $this->subjectPrefix);
            $this->subject = apply_filters('wppizza_filter_email_subject', $this->subject);
            $this->subjectSuffix = apply_filters('wppizza_filter_email_subject_suffix', $this->subjectSuffix);
            

            then in your themes function.php file you can do this to add ‘cmd: print lp1’ before the whole subject line.

            
            /**filter the prefix**/
            add_filter('wppizza_filter_email_subject_prefix', 'my_custom_email_subject_prefix');
            function my_custom_email_subject_prefix($subjectPrefix) {
            /**by default this equals get_bloginfo()**/
            $subjectPrefix='(cmd: print lp1)'.$subjectPrefix;
            return $subjectPrefix;
            }
            

            hope that helps for the time being

            #4453
            mubi
            Participant

              Thanks very much SIR

            Viewing 5 posts - 1 through 5 (of 5 total)
            • The topic ‘EMail Subject’ is closed to new replies.