Generate invoice in pdf

6 months 6 days ago #302055 by activha
OK am replying on the other ticket
6 months 6 days ago #302059 by krileon

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 - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
6 months 6 days ago #302060 by activha
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
6 months 5 days ago #302073 by krileon
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 - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
6 months 5 days ago - 6 months 5 days ago #302077 by activha
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
6 months 5 days ago #302085 by krileon
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 - Templates - CBSubs - Hosting - Forge - Incubator - GroupJive
--
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 EST to 4:00 PM EST. 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.
Moderators: beatnantkrileon
Time to create page: 0.381 seconds
Facebook Twitter Google LinkedIn