Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

Patrick Koch
Patrick Koch
40,627 Points

HTML Email

Hello treehouse comunity,

Is it possible to integrate the 'HTML-Emails' with phps require or include function? and if how ? The HTML -Emails are realy nice the only thing they are realy long, so I wanted to keep em in a separeted file.

Thanks alot patrick

1 Answer

Hi Patrick, I don't think you would be able to use PHP in an email as it needs a server to run.

You may be able to achieve a similar workflow using Hammer for Mac. When working you can use Hammer's HTML includes. When you are finished you can "build" your project which will compile everything together in one HTML document that you could use for the email.

Alternatively you could still use PHP to make the email, view it in a browser, then copy the source of the displayed page and save that as one file.