Coder Social home page Coder Social logo

Attaching PDFs about nativescript-email HOT 9 OPEN

eddyverbruggen avatar eddyverbruggen commented on September 28, 2024
Attaching PDFs

from nativescript-email.

Comments (9)

EddyVerbruggen avatar EddyVerbruggen commented on September 28, 2024

Can you show the actual code?

from nativescript-email.

sroy93 avatar sroy93 commented on September 28, 2024

Sure. Here's the piece of it that contains the email portion: (See below the code for the value of the attachment path variable)

email.available().then((avail: boolean) => {
if(avail) {
dialogs.prompt({
title: "Enter Email",
message: "Please enter the address you want to send the document to below",
okButtonText: "Send",
cancelButtonText: "Cancel",
inputType: dialogs.inputType.email
}).then((r) => {
if(r.result = true) {
if(r.text != "") {
email.compose({
subject: "CPU Signed Form - " + this.cpuOrder.OrderNumber,
body: "See attachment.",
to: [r.text],
attachments: [
{
fileName: this.cpuOrder.OrderNumber + '-SIG.pdf',
path: this.pdfPath,
mimeType: 'application/pdf'
}]
}).then(
function() {
console.log("Email composer closed");
}, function(err) {
dialogs.alert({
title: "Email Not Sent"
,message: "Error: " + err
,okButtonText: "Ok"
});
});
}
else {
dialogs.alert({
title: "Enter a Valid Email"
,message: "Please enter an email address"
,okButtonText: "Ok"
});
}
}
})

                }
                else {
                    dialogs.alert({
                        title: "Email Not Supported"
                        ,message: "This device does not support OR is not set up for emailing."
                        ,okButtonText: "Ok"
                    });
                }

The error reads: "File not found for path: http://cpuimages.ivansmith.com/CPUImages/SignaturePDFs/1001903LG28-SIG.pdf"

So that is going to be the value of the variable in the code.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on September 28, 2024

Quite frankly, I can't access that file either:

Screenshot 2019-11-06 at 20 59 12

from nativescript-email.

sroy93 avatar sroy93 commented on September 28, 2024

Well you aren't going to be able to if you aren't on the correct network. I can though from a browser.

from nativescript-email.

sroy93 avatar sroy93 commented on September 28, 2024

I am also displaying the PDF via another NativeScript plugin using the same variable, so the same URL. So it is not as though the app itself cannot access it.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on September 28, 2024

Let’s not complicate things. Do you have the same issue with a publicly available pdf (please post an example)

from nativescript-email.

sroy93 avatar sroy93 commented on September 28, 2024

Good thought. I tried replacing the variable in my code with the public URL you find here. It gives the same error.

email.available().then((avail: boolean) => {
if(avail) {
dialogs.prompt({
title: "Enter Email",
message: "Please enter the address you want to send the document to below",
okButtonText: "Send",
cancelButtonText: "Cancel",
inputType: dialogs.inputType.email
}).then((r) => {
if(r.result = true) {
if(r.text != "") {
email.compose({
subject: "CPU Signed Form - " + this.cpuOrder.OrderNumber,
body: "See attachment.",
to: [r.text],
attachments: [
{
fileName: this.cpuOrder.OrderNumber + '-SIG.pdf',
path: "https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf",
mimeType: 'application/pdf'
}]
}).then(
function() {
console.log("Email composer closed");
}, function(err) {
dialogs.alert({
title: "Email Not Sent"
,message: "Error: " + err
,okButtonText: "Ok"
});
});
}
else {
dialogs.alert({
title: "Enter a Valid Email"
,message: "Please enter an email address"
,okButtonText: "Ok"
});
}
}
})

                }
                else {
                    dialogs.alert({
                        title: "Email Not Supported"
                        ,message: "This device does not support OR is not set up for emailing."
                        ,okButtonText: "Ok"
                    });
                }
            })

from nativescript-email.

sroy93 avatar sroy93 commented on September 28, 2024

Is there any update on this by chance? I have now tested this on an Android, as well as, iOS and the issue occurs on both.

from nativescript-email.

EddyVerbruggen avatar EddyVerbruggen commented on September 28, 2024

I have not found time to look into it. Flagging it as "help wanted" so perhaps someone else can step in.

from nativescript-email.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.