Generate invoice in pdf

6 years 2 months ago #302055 by activha
Replied by activha on topic Generate invoice in pdf
OK am replying on the other ticket

Please Log in to join the conversation.

6 years 2 months ago #302059 by krileon
Replied by krileon on topic Generate invoice in pdf

Sorry I meant access INVOICE_CONTENT_HTML in an email auto action and not a code auto action.

No, it's not accessible to an email action. Your code action can send an email using Joomla or CB API though so it is doable.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 2 months ago #302060 by activha
Replied by activha on topic Generate invoice in pdf
That would be great as we can send the mail to our system which would generate the pdf for the accounting

So what would be the call to the CB API to send the mail to the user with a hidden copie to our system, say accounting@ourwebsite.com ?

I did not found any reference on the forum or doc

Please Log in to join the conversation.

6 years 2 months ago #302073 by krileon
Replied by krileon on topic Generate invoice in pdf
CBs email function is as follows.

/**
 * Mail function (uses phpMailer or SMTP depending on global settings)
 *
 * @param  string        $from         From e-mail address
 * @param  string        $fromname     From name
 * @param  string|array  $recipient    Recipient e-mail address(es)
 * @param  string        $subject      E-mail subject
 * @param  string        $body         Message body
 * @param  int           $mode         false = plain text, true = HTML
 * @param  string|array  $cc           CC e-mail address(es)
 * @param  string|array  $bcc          BCC e-mail address(es)
 * @param  string|array  $attachment   Attachment file name(s) (array index is filename, if string)
 * @param  string|array  $replyto      ReplyTo e-mail address(es)
 * @param  string|array  $replytoname  ReplyTo name(s)
 * @param  array         $properties properties to apply to the mailer object before processing and sending (useful for supplying custom mailer)
 * @param  null|string   $error stores most recent mailer error if available
 * @return bool True: mail sent, False: mail not sent (error)
 */
function comprofilerMail( $from, $fromname, $recipient, $subject, $body, $mode = 0, $cc = null, $bcc = null, $attachment = null, $replyto = null, $replytoname = null, $properties = array(), &$error = null )

This handles the entire process of sending the email and all you'll need to do is supply the necessary parameters in the PHP of your code action. You can of course use Joomla API as well if you're more comfortable with Joomla API.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

6 years 2 months ago - 6 years 2 months ago #302077 by activha
Replied by activha on topic Generate invoice in pdf
That's really great so we have now invoices in pdf in our accounting system :-)

Now there is just one question left which is the css display in the email.

Using the website we have a css override allowing to have nice looking invoices. it does not seem like the email sent uses this css
Do we have to make another one elsewhere ?

I've set $mode = 1 to send mail in html by the way and also tried to insert a <style> tag in the CBsubs invoice display setting, but no luck until now

Please Log in to join the conversation.

6 years 2 months ago #302085 by krileon
Replied by krileon on topic Generate invoice in pdf
You'd need to do an inline CSS element directly in your email for that email to load your sites CSS. It's best to do this in a small lightweight CSS file that has only the CSS you need for it to be styled.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.260 seconds

Facebook Twitter LinkedIn