Sending Mailgun Inline Images in HTML using FuelPHP and Twig
<p>I had this line of code that intentionally sending confirmation email to whoever filling out the contact form. Usually, i only send texts but i'm thinking to send image inside that email. I uploaded the image on postimg.org and put it in twig format but the image didn't appear. So, let's get to the case</p>

<p><strong>PHP</strong></p>

<pre><code>private function _send_email($post_data) {
        $data = array(
            'email_from' =&gt; 'website@XXXXX.co.id',
            'email_to' =&gt; \Config::get('config_basic.contact_us_email_to'),
            'email_subject' =&gt; 'Contact Us message from ' . $post_data['name'],
            'mail_subject' =&gt; 'Enquiry Confirmation from XXXXX',
            'email_reply_to' =&gt; array(
                'email' =&gt; $post_data['email'],
                'name' =&gt; $post_data['name']
            ), // Optional
            'email_data' =&gt; array(
                'base_url' =&gt; \Uri::base(),
                'name' =&gt; $post_data['name'],
                'email' =&gt; $post_data['email'],
                'message' =&gt; $post_data['message']
            ),
            'email_view' =&gt; 'pages::email/contact_us.twig',
            'email_respond_view' =&gt; 'pages::email/email_responder.twig',
        );

        \Util_Email::queue_send_email($data);
        $email = \Email::forge();

        // Set the from address
        $email-&gt;from($data['email_from'], 'XXXXX');
        // Set the to address
        $email-&gt;to($data['email_to'],'Web Admin of XXXXXX');
        // Set a subject
        $email-&gt;subject($data['email_subject']);
        // And set the body.
        $email-&gt;html_body(\View::forge($data['email_view'], $data['email_data']));

        $email-&gt;send();

        $mail = \Email::forge();
        $mail-&gt;from($data['email_from'], 'XXXXXX');
        $mail-&gt;to($data['email_data']['email'],$data['email_data']['name']);
        $mail-&gt;subject($data['mail_subject']);
        $mail-&gt;html_body(\View::forge($data['email_respond_view'], $data['email_data']));

        $mail-&gt;send();
    }
</code></pre>

<p><strong>TWIG (email_responder.twig)</strong></p>

<pre><code>{% block frontend_content %}
    Dear {{ name }}, &lt;br/&gt;&lt;br/&gt;
    Thank you for contacting us,&lt;br/&gt;
    our sales team would be contacting you as soon as possible&lt;br/&gt;&lt;br/&gt;
    Best Regards,&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
    XXXXXX
    &lt;div&gt;&lt;img src="https://postimg.org/image/ynhb45hrx/" alt="city"/&gt;&lt;/div&gt;
{% endblock %}
</code></pre>

<p>I only get texts with image with broken link! Would you please me give me the right way to do it?</p>

<p>Thanks</p>