Fusion Manage Forum
Welcome to Autodesk’s Fusion Manage (formerly Fusion 360 Manage) Forum. Share your knowledge, ask questions, and explore popular Fusion Manage topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help with email script

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
sdibben
812 Views, 6 Replies

Help with email script

I have a question regarding an email script.  I need to email a print view of a workspace to two individuals.  I have no problem with the script for one person but if I try combine two email addresses it will not work

 

FIELD1 holds an email address

 

var email = new Email();
var emailbody= getPrintView('EMAIL');
var owner = Security.loadUser (userID);
var ownerEmail = owner.email;

 

email.to = item.FIELD1 +';' + ownerEmail;

email.subject = ' Estimate';
email.body = emailbody;
email.send();

 

This looks correct when sending this as a combined variable to a text field.  The script shows no errors but does not seem to work.  Thanks for any help

Tags (1)
6 REPLIES 6
Message 2 of 7
jpiggee
in reply to: sdibben

Scott,

 

Have you tried building out your email address list to a variable first then using that in the email.to field?

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 3 of 7
sdibben
in reply to: sdibben

This is what I tried for building it into a variable.  This was also unsuccessful.   Let me know if you see anything wrong.

 

FIELD1 holds an email adress

 

var email = new Email();
var emailbody= getPrintView('EMAIL');
var owner = Security.loadUser (userID);
var ownerEmail = owner.email;

var totalEmail = item.FIELD1 + ';' + ownerEmail;

 

email.to = totalEmail;
email.subject = 'Estimate';
email.body = emailbody;
email.send();

 

If I use email.to = ownerEmail or email.to = item.FIELD1 it works fine.  I have not been able to put these together.

 

 

 

Message 4 of 7
jpiggee
in reply to: sdibben

Scott,

 

Sorry I was thinking a version past what we’re working with…

 

In the 8.0 release (next month) you will be able to use comma delimited listing for multiple email address entries.

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 5 of 7
sdibben
in reply to: sdibben

I'm having problems with the email script not completing again.  It is initiated by a transition.  It shows no errors on the script after running.

 

FIELD1 contains an email address.

SE_EMAIL is an advanced print view created in the workspace

 

var email = new Email();
var emailbody= getPrintView('SE_EMAIL');
var owner = Security.loadUser (userID);
var ownerEmail = owner.email;


email.to = item.FIELD1;
email.cc = ownerEmail;
email.subject = 'Estimate provided';
email.body = emailbody;
email.send();

 

This has worked in the previous weeks without the email.cc field.  I commented out the email.cc and ran the script again.  It still did not complete.

Message 6 of 7
jpiggee
in reply to: sdibben

Scott,

 

What are your results if you do a

Println(item.FEILD1);

and

Println(ownerEmail);

Joseph Piggee
Fusion 360 Administrator
TPI Composites
jpiggee@tpicomposites.com
Message 7 of 7
sdibben
in reply to: sdibben

Joe,

  The printIn helped to identify the problem, thanks.  I moved the field holding the email address to the "unassigned field" column in the workspace.  This field is derived from another workspace and has no real value to the workspace except to hold a value for the email script.  I have a few of these unassigned fields in the workspace.  So apparently the unassigned fields are not available for scripting to access?  As soon as I moved it back to "item details field" column in the workspace the script could access the value again.

  I use these "unassigned field" items as values in computed field formulas and they can retrived the values where the scripts can't.  Is this intended for some reason?  Let me know if you need more information.  Thanks

 

Scott Dibben

D3 Technologies

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report