Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Aurovrata Venet

    (@aurovrata)

    this plugin has no effect on the mail body structure with the exception of table and tabbed fields. (see faq #14 bis)

    are you using table fields?

    If not what kind of mail structure are you expecting?

    Thread Starter keldn

    (@keldn)

    Hi

    using this in my functions.php:

    add_filter( ‘cf7sg_mailtag_grid_fields’,’insert_table_in_mail’,10,4);
    /**
    * this filter is used to build an html formated string to rpelace a mail tag of a field that is in a table or tab structure. NOTE: this filter is only fired if the mail format is set to html.
    * In case the field is in a table that is within a tab, then the $data field will be an array of arrays.
    * @param string $html an empty html string to filter.
    * @param string $field the name of the file field being attached
    * @param string $data an array of submitted data.
    * @param string $cf7_key unique form key.
    * @return string an html string to replace the mail tag.
    */
    function insert_table_in_mail($html, $field, $data, $cf7_key){
    if(‘bestil-smart’!==$cf7_key){ //always validate the form being submitted.
    return $html;
    }
    $build = true;
    switch($field){ //if either of fields present in the table…
    case ‘nummer’:
    $label = ‘Nummer’;
    $html ='<ul style=”list-style-type:none;border-right:1px solid black;display:inline-block;float:left;padding:5px”>’;
    break;
    case ‘antal’:
    $label = ‘Antal’;
    $html ='<ul style=”list-style-type:none;border-right:1px solid black;display:inline-block;float:left;padding:5px”>’;
    break;
    case ‘stoerelse’:
    $label = ‘St?rrelse’;
    /*styling for last column*/
    $html ='<ul style=”list-style-type:none;display:inline-block;clear:right;padding:5px”>’;
    break;
    default: //else this isn’t a field we want in the table.
    $build=false;
    break;
    }
    if($build){
    $html .='<li style=”background-color:lightgray;margin:0;padding:3px 5px”>’.$label.’‘;
    foreach($data as $key=>$value){
    $html .='<li style=”margin:0px;padding:3px 5px”>’.$value.’‘;
    }
    $html .=’‘;
    }
    return $html;
    }

    And a look like https://ibb.co/3zqbxmd would be perfect ??

    Plugin Author Aurovrata Venet

    (@aurovrata)

    the filter helper code I have created is meant to be just that, a helper code ??

    Outlook is is notoriously poor at applying html standards.

    You will need to find an alternative html/css structure to display your table in outlook.

    If you do find a way to solve this, please do post it on this thread for others to see.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Email not looking perfect’ is closed to new replies.