Search code examples
emailcakephpattachmentdocxdoc

cakephp write doc/docx


On user registration, I want to email with attachment a document and it should contain dynamic user guarding name, into document, do you have any idea about such component/helpers with cakephp?

Earliest reply would be appreciated.

Thanks !


Solution

  • I'm not sure what you mean by "dynamic user guarding name," but a trick I saw with an RTF file if you can send an RTF file instead of doc/docx is to save a template as you'd like it to go in the email, but use something like %%VARIABLE%% in the document wherever you want to replace a variable.

    Then, to send the file, you have PHP parse it and replace the %%VARIABLE%% with the name you want to insert and send that file as the attachment.

    The doc and docx files are in binary and I don't know how to handle that. Usually RTF, which is not, works for word files.

    I hope I understood your question and this helps.