Title: Template Variables?
Last modified: August 31, 2016

---

# Template Variables?

 *  Resolved [melriks](https://wordpress.org/support/users/melriks/)
 * (@melriks)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/template-variables/)
 * Are there any other template variables available (i.e., {FILELINK} or {FILENAME}).
   I’m looking for category assigned or email subject. We have several non-tech 
   users sending in attachments. To minimize goof-ups, I’d like to pull the subject
   into the email template to provide quick formatting.
 * [https://wordpress.org/plugins/postie/](https://wordpress.org/plugins/postie/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Wayne Allen](https://wordpress.org/support/users/wayneallen-1/)
 * (@wayneallen-1)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/template-variables/#post-7116575)
 * Just the ones listed on the Postie Image tab.
 * I’m not quite sure what you’re trying to accomplish. Can you give me an example?
 *  Thread Starter [melriks](https://wordpress.org/support/users/melriks/)
 * (@melriks)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/template-variables/#post-7116578)
 * We have two menus and two event calendars. We’re sending them in as pdf attachments.
   In the attachment template, I have “<p>[Current Menu](https://wordpress.org/support/topic/template-variables/{FILELINK}?output_format=md)
   </p>”
 * What I really need is
    <p>[{EmailSubject}](https://wordpress.org/support/topic/template-variables/{FILELINK}?output_format=md)
   </p>
 * I need to be able to change out the words of the anchor depending on the email
   sent in.
 *  Thread Starter [melriks](https://wordpress.org/support/users/melriks/)
 * (@melriks)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/template-variables/#post-7116589)
 * Just in case someone else wants to try this…I built a custom loop that finds 
   the child page and child page’ attachment url. Show’s a link.
 * {cat} is the post category
    {anchortext} is the text of the link
 *     ```
       //Custom Loop
   
       define( 'WP_USE_THEMES', false );
   
       $arg = array(
       	'post_type' => 'post',
       	'cat' => {cat},
       	'posts_per_page' => 1,
       );
   
       $my_wp_query = new WP_Query( $arg );
       	while($my_wp_query->have_posts()) {
       		$my_wp_query->the_post();
   
       //Variables for content
       $post_id = $my_wp_query->post->ID;
       $post_link = get_permalink();
   
       // Get the child ids
       $children_args = array(
          'post_type' => 'attachment',
          'numberposts' => -1,
          'post_status' => null,
          'post_parent' => $post_id
         );
   
       //Echo the results of the child ids
   
       $attachments = get_posts( $children_args );
            if ( $attachments ) {
               foreach ( $attachments as $attachment ) {
       $child_id = $attachment->ID;
                  echo '<div>';
       $attachment_page = wp_get_attachment_url( $attachment->ID );
                  echo "<p class=\"{class}\" id=\"$post_id\">";
       echo"<a class=\"button red full-width\" href=\"$attachment_page\" id=\"$child_id\">{anchortext}</a>";
                  echo '</p></div>';
                 }
            }
   
       // Wrap up php
   
       	} // end while
       wp_reset_postdata(); // reset the query
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Template Variables?’ is closed to new replies.

 * ![](https://ps.w.org/postie/assets/icon-256x256.png?rev=970083)
 * [Postie](https://wordpress.org/plugins/postie/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/postie/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/postie/)
 * [Active Topics](https://wordpress.org/support/plugin/postie/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/postie/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/postie/reviews/)

## Tags

 * [template variables](https://wordpress.org/support/topic-tag/template-variables/)

 * 3 replies
 * 2 participants
 * Last reply from: [melriks](https://wordpress.org/support/users/melriks/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/template-variables/#post-7116589)
 * Status: resolved