NetSuite REST Services - Company Address - rest

I am working on external application to pull data from NetSuite using NetSuite's REST services.
Unable to find the way to pull Company Address.
Please respond if you the way.

The Company's address would be present in NetSuite's Company Information section (i.e navigate to Setup --> Company --> Company Information).
If you are using a NetSuite Restlet script to pull Company address, you need to use "N/config" module.
So using the N/config module, load the company information record:
var companyInfo = config.load({
type: config.Type.COMPANY_INFORMATION
});
// then get value of Company address
var companyAddress = companyInfo.getValue({
fieldId: 'mainaddress_text'
});
return companyAddress; // return the address in Restlet script
Hope this helps.

Related

How to retrieve the remote Ip address for a Contact Form 7 submission?

I am using Contact Form 7 to collect data and send it through the CF7 to API Plugin.
For security reasons, I receive the data via email through the [wpcf7.remote_ip] tag, which I insert in the email field as per the guide.
Screen of The Email Body:
But when I try to send the same data via API through "CF7 to API", the value is empty.
Screen of the CF7 to API setup:
Where am I wrong?
Screen of the CF7 to API log:
wpcf7.remote_ip is only valid in an email template because it is created/populated by the CF7 plugin when the notification mail is being processed. You will need to create your own hidden field on the form when the page is loaded which you can then use in your API listing,
add_filter('wpcf7_form_hidden_fields','add_hidden_ip_field');
function add_hidden_ip_field($fields){
$fields['remote_ip'] = ... //get the remote IP
return $fields;
}
NOTE: to get the request remote IP, see this answer
You can then use the field remote_ip in your API

Get current logged in user using Exchange SOAP web services

we are using Exchange 2010 SP1 SOAP web services. I can't find the API to get the current (authenticated) user's information.
If you want to get the current user’s own email:
You could use ConvertId with a generic address and Exchange will then return the PrimarySMTP for that mailbox eg:
Folder Inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
AlternateId aiAlternateid = new AlternateId(IdFormat.EwsId, Inbox.Id.UniqueId, "mailbox#domain.com");
AlternateIdBase aiResponse = service.ConvertId(aiAlternateid, IdFormat.EwsId);
Console.WriteLine(((AlternateId)aiResponse).Mailbox);
AutoDiscover will also return the PrimarySMTP address of a Mailbox is you do a POX based discovery.
To check other addresses you can also use ResolveName:
Resolve ambiguous names by using EWS in Exchange 2013
If you want to get the displayname of the logged in user in EWS:
If you are going to use ResolveName and you want the displayName then you should use the overload to specify that the operation should return the AD contact information. Then you can just use the DisplayName property.
NameResolutionCollection ncCol = service.ResolveName("user#domain.com",ResolveNameSearchLocation.DirectoryOnly,true);
Console.WriteLine(ncCol[0].Contact.DisplayName);
For more information, you could refer these link:
How do I get the displayname of the logged in user in EWS?
How get the current user's own email address or check entered, using Exchange Web Services?

TYPO3 tt_products: send a tracking email on status change to admin as well as user

I use tt_products 2.7.18 on TYPO3 6.2.25.
I configured orderEmail_to to the admins email address.
When an order is placed the customer and the admin gets a respective email - as expected.
But when I change the tracking status, only the customer gets an email.
The manual does not tell me how to configure and I'm starting to question the possibility altogether.
Can anyone tell me if and how to configure?
Thanks in advance.
plugin.tt_products {
...
orderEmail_to = admin#emaildomain.com
...
}
It is correct to set the orderEmail_to. You should check in the TypoScript Object Browser (backend module Template) that this setup is applied on your tracking page id, where in this example I have given "admin#emaildomain.com" as the admin's email address.
Only the tracking status numbers between 50 and 59 will send a notification email to the customer.
tt_products 2.7.27 is already available. Maybe your version 2.7.18 is already outdated.

I need a script to show different banner based on state or city using visitor IP address

I need tips on a simple ad management script/software that allows me to set specific locations with city and/or state for the banner to show.
Im using wordpress
thanks!
You can fetch visitor city/state via php or js using geoplugin json web service:
http://www.geoplugin.net/json.gp?ip=129.74.193.44

Send gmail from web application hosted on Azure

Newbie to Azure, but got my application successfully published to the cloud as well as my needed database backends (SQL server).
Everything within the application is working as expected except email functionality. I am sending out email alerts via a gmail account, but they do not appear to get sent out. The application does not crash and trying to configure remote debugging has proven difficult.
This is the snippet I am using to send out my emails:
//Parse html document which will show in outgoing email
StreamReader reader = new StreamReader(HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["template"]));
string body = reader.ReadToEnd();
//Populate placeholders with message variables
body = body.Replace("<%holder%>", value);
...Omitted for brevity
try
{
var smtp = new SmtpClient
{
Host = "smtp.gmail.com",
Port = 587,
EnableSsl = true,
DeliveryMethod = SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new NetworkCredential(fromAddress.Address, fromPassword)
};
using (var message = new MailMessage(fromAddress, toAddress)
{
IsBodyHtml = true,
Subject = subject,
Body = body,
})
{
smtp.Send(message);
}
}
Application didn't crash, so no error message to go off of. So I thought maybe it wasn't able to grab the file in the lines:
StreamReader(HttpContext.Current.Server.MapPath(ConfigurationManager.AppSettings["template"]));
string body = reader.ReadToEnd();
So I tried just sending a hardcoded string as a test:
string body = "test";
Still no email received and no error message to go off of. I'm new to azure web hosting, but is there some configuration I could be missing here? Does Azure allow sending email through third party email clients? Fyi - the above code works against localhost.
Sending e-mail from a public cloud is not as trivial as some people believe. There are a lot of things to figure out in order to not get blacklisted. Especially when you intend to use a public mail service.
My first guess is that Azure Data Center IP addresses (or the one you are hosted on) might be blacklisted by mail servers (including Microsoft's very own Office 365).
I have to also mention that recommended way for sending e-mail from an Application hosted in Azure is by using SendGrid. They have a free tier. More information from Microsoft on that subject, can be found here.
The only way to troubleshoot the exact cause of your problem is to contact GMail support and ask them if they block in any way network clients connecting from Azure cloud. Or create a VM in the same Data Center where your web application lives, install some free / trial Mail client, configure it with Google Mail and try to send e-mails. The result most probably will be same as with your application.