Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter fjalestad

    (@fjalestad)

    After trial-error I found this to be working. I hope someone else find this useful as I was searching all over for a solution..

    [function.php]

    function add_email_logo($message) {
      // Add cid image to $message
      $logobase64 = "iVBORw0KGgoAAAANSUhEUgAAAEMA....etc.";
    
      $images = array (
        'images' => array (
          array (
                  'type' => 'image/png',
                  'name' => 'logo',
                  'content' => $logobase64
          )
        )
      );
    
      $message = array_merge( $message, $images);
    
      return $message;
    }
    add_filter( 'mandrill_payload', 'add_email_logo' );

    All I needed to do was to add the matching img source in my HTML email template stored in Mandrill using the same name = ‘logo’, cid = ‘logo’. Setting the width is recommended but not necessary.

    <img src="cid:logo" height="XX" width="XX"/>

    PS. I admit this isn’t the way to do it with larger images… but for small logo’s it works like a charm =)

    Thread Starter fjalestad

    (@fjalestad)

    Thx wpMandrill for a great plugin!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Suggestions for adding image’ is closed to new replies.