Accessing relation data in an on save entry event I have a front end form that saves an entry with a relation field based on an ID. 

&lt;input type="hidden" name="items[{{ index }}][finish]" value="{{ finish.id }}"&gt;


When the entry is saved this ID saves the field with the correct category relation.

I then have a plugin which triggers on entry save that sends an email and attaches the $entry.

craft()-&gt;on( 'entries.saveEntry', function( Event $event ){
    $entry = $event-&gt;params['entry'];
    if( !$event-&gt;params['isNewEntry'] || $entry-&gt;section-&gt;handle != 'sampleOrders' )
    {
        return;
    }
    //die(Craft::dump($entry-&gt;samplesOrder[0]-&gt;finish-&gt;find()));
    $email = new EmailModel();
    $email-&gt;toEmail = 'luke@ten4design.co.uk';
    $email-&gt;subject = 'Order Received';
    $email-&gt;body = '';
    $email-&gt;htmlBody = craft()-&gt;templates-&gt;render( 'pentagonemailservice/_emails/order', array(
        'entry' =&gt; $entry
    ) );
    try{
        craft()-&gt;email-&gt;sendEmail( $email );
    }
    catch( Exception $e ){
        Craft::log( 'Could not send email.', LogLevel::Error );
    }
} );


For some reason in my email template I cannot access the finish field with the following code. The other fields print correctly. The finish field is a category relation.

{% for item in entry.samplesOrder %}
    {% set appr = craft.entries.section( 'appearances' ).apprId( item.appearance ).first() %}

    &lt;h3 class="appearance__name h beta"&gt;&lt;a class="a" href="{{ appr.url }}"&gt;{{ appr.apprId }} - {{ appr.displayName }} - {{ appr.pentagonRange[0].title }}&lt;/a&gt;&lt;/h3&gt;

    &lt;h3 class="h h6 caps--spaced m-b--05"&gt;Material&lt;/h3&gt;
    &lt;p class="appearance__material h delta basket-bits"&gt;{{ appr.material }}&lt;/p&gt;

    &lt;h3 class="h h6 caps--spaced m-b--05"&gt;Finish&lt;/h3&gt;
    {#&lt;p class="basket-bits"&gt;{{ finish.title }}&lt;/p&gt;#}

    &lt;h3 class="h h6 caps--spaced m-b--05"&gt;Quantity&lt;/h3&gt;
    &lt;p class="basket-bits"&gt;{{ item.quantity }}&lt;/p&gt;
{% endfor %}


How do I access the finish field in my email template?
Related elements, such as categories, are stored by Craft as arrays, even if there is only a single element to be stored.

In your entry form, you don't appear to be storing an array, but only the id of the selected category:

&lt;input type="hidden" name="items[{{ index }}][finish]" value="{{ finish.id }}"&gt;


This seems to be borne out by what you see when you dump the item variable in your email template. item[finish] should be an array, even if only a single category is assigned to it.

Try using the following in your entry form to see if that helps, which should store the category id as an array:

&lt;input type="hidden" name="items[{{ index }}][finish][]" value="{{ finish.id }}"&gt;


You should then be able to access the correct value for the category title using the code in @carlcs answer.