which they are the files that control a campaign web version?

Discussion in 'General discussions' started by jera, Jun 2, 2015.

  1. jera

    jera Member

    Joined:
    Feb 16, 2015
    Messages:
    106
    Likes Received:
    6
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hello everyone

    I wish to add a top bar in an email campaign, with share options, but that I want to know what are the files that control the web version of the email.

    I hope you can help me with this.

    Thank you.

    Greetings.
     
  2. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,592
    Likes Received:
    2,460
    The controller that generates this is apps/frontend/controllers/CampaignsController.php
     
  3. jera

    jera Member

    Joined:
    Feb 16, 2015
    Messages:
    106
    Likes Received:
    6
    S.E:
    Expired
    L.T:
    Regular
    L.C:
    1
    Hello and thank you very much for your prompt response, I have a question, if I wanted to add an element of html type, either a div or h1, etc. And I want that item is added to all html files generated in campaigns where did you add? :D
     
  4. twisted1919

    twisted1919 Administrator Staff Member

    Joined:
    Dec 27, 2014
    Messages:
    10,592
    Likes Received:
    2,460
    Well,

    Currently, the actionWeb_version method in the controller echoes the campaign content, so it's:
    PHP:
    public function actionWeb_version($campaign_uid$subscriber_uid null)
        {
           [...]
            echo 
    $emailContent;
        }
    You could make it something like:
    PHP:
    public function actionWeb_version($campaign_uid$subscriber_uid null)
        {
           [...]
            
    $myContent '<div id="share-widgets">lots of html</div>';
            
            
    // parse the html
            
    if (!CommonHelper::functionExists('qp')) {
                require_once(
    Yii::getPathOfAlias('common.vendors.QueryPath.src.QueryPath') . '/QueryPath.php');
            }
            
    $query qp($emailContent'body', array(
                    
    'ignore_parser_warnings'    => true,
                    
    'convert_to_encoding'       => Yii::app()->charset,
                    
    'convert_from_encoding'     => Yii::app()->charset,
                    
    'use_parser'                => 'html',
             ));  
            
    // http://api.querypath.org/docs/class_query_path.html#a01c2fc8e3d0725854fcd01f3c5972a5f
            
    $query->prepend($myContent);
            
    $emailContent $query->top()->html();
            echo 
    $emailContent;
        }
     

Share This Page