Like I wrote in my last comment to your other question, if you plan to send heavy files to Cloud Functions, bear in mind that the size limit for data sent to an HTTP Cloud Functions is 10MB (See doc). There is the same limit for the size of messages you can push to Pub/Sub. (See doc).
One approach would be to upload the files (data and template) to Cloud Storage and pass their references to the HTTP Cloud Function and, from this one, pass them in the payload of the Pub/Sub message (as explained in the other answer). Then in the Pub/Sub Cloud Function, you read the files from Cloud Storage.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…