Jump to content

Timothy de Vos

Members
  • Posts

    12
  • Joined

  • Last visited

Posts posted by Timothy de Vos

  1. I recently had one of my website's tested on security and the following error came out. 

    The following cookie does do not have the Secure cookie flag: 
    Cookie name: wire, Path: /, Secure Flag: 0 

    Can anybody explain to me what this means and what the security risk are here?

     

  2. 1 minute ago, adrian said:

    You don't sound thrilled :)

    Do you have any other ideas / preferences?

    I could add support for pulling in a template stored in the file system, but I feel like that might be overkill for a simple email like this - I can't see it requiring very much structure/styling for a simple account registration email.

    Sorry... I mean that would be perfect! :)

    And you're right it doesn't need much styling. I just like it to have the same feeling as the rest of the website.

    Right now i've added a little extra code to have an extra option like {adminURL}. I'm registrating users that only work on the front-end. Each user is bound to a location and for the front-end login url I need the parent name of the location. So for now i added this extra code to the parseBody function:

      elseif($field == "location") {
          $pageId = $page->$field;
          $replacement = "http://".wire($pageId)->parent->name.".".wire('config')->httpHost;
      }

    i don't know if there is an other easier way to do this?

  3. 2 minutes ago, adrian said:

    Hi @Timothy de Vos - I could simply support HTML in that email body field and have the email sent as HTML along with a plain text version (automatically generated from the HTML version). I think that would be the easiest approach.

    Would that suit your needs?

    Jeah i guess that would work!

  4. On 6-12-2016 at 4:45 PM, Wanze said:

    As mentioned in my post, as far as I know, you need to render your image in a regular <img> tag inside the PDF template. This means that you'd need to save the image before on the disk or use a base64 encoded string, though I don't know if the latter works in mpdf.

    I got it to work! The problem was that I was using $.post in jQuery to sent the data to de PDF template. Since $.post doesn't actually goes to the page i added an extra event to load the page. But by doing this i emptied the $POST session... stupid. 

    What i'm doing now is first creating a form and setting the img as value and then submitting the form.

            $("body").append($("<form></form>").attr({ "action": PDFurl, "method": "post", "id" : "postForm" })
                .append($('<input>').attr({ "type": "hidden", "name": "img", "value": imgChart.prop("outerHTML") }))
            ).find("#postForm").submit();

     

  5. 18 hours ago, bernhard said:

    do you have some user input or are you creating the pdf completely on the server side (like cronjob)? if you have some user input you could create an image of the chart first (eg on button click) and then post this image to your php script and integrate it in your pdf

    I am able to create the image on a button click but how would I post it to the PDF template. I tried using $.post but when i try to var_dump the $POST in the PDF it returns an empty array.

  6. Thanks for the great plugin!

    I'm trying to put a piechart in a PDF page. I understand using Javascript is not supported in PDF but with Google Charts it's possible to create an image for print/PDF. So i thought maybe in my template i can first run the Javascript to render an image and use that image in de PDF. This unfortunately doen't work. Is there a way to run some javascript to render an element before the PDF is created?

×
×
  • Create New...