how do i get gravity forms using the gravity after_submission hook to send a submission in xml format. I have the xsd schema import file to use as an outline but haven't been able to find any references on how to get gravity forms to send an xml file. anyone got any idea's. here is the xsd file<?xml version="1.0" encoding="utf-8"?>
<xs:schema
targetNamespace="http://schemas.promeric.com/AscendIIXMLSchema/v1"
elementFormDefault="qualified"
xmlns="http://schemas.promeric.com/AscendIIXMLSchema/v1"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:q1="http://schemas.promeric.com/AscendIIXMLSchema/v1"
>
<xs:element name="IIBankrupt">
<xs:complexType>
<xs:sequence>
<xs:element name="tblIIBankrupts" type="q1:typeIIBankrupts" minOccurs="1" maxOccurs="1" />
<xs:element name="tblIIBankruptsBillingNotes" type="q1:typeIIBankruptsBillingNotes" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="typeIIBankrupts">
<xs:sequence>
<xs:element name="banFileNumber" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banStatus" type="typeIIStatus" minOccurs="0" />
<xs:element name="banInterviewStatus" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banNameFirst" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banNameMiddle" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banNameLast" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banSex" type="typeSex" minOccurs="0" />
<xs:element name="banHomePhone" type="typePhone" minOccurs="0" />
<xs:element name="banWorkPhone" type="typePhone" minOccurs="0" />
<xs:element name="banExtension" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banDateOfBirth" type="typeDate" minOccurs="0" />
<xs:element name="banMaritalStatus" type="typeMaritalStatus" minOccurs="0" />
<xs:element name="banCellPhone" type="typePhone" minOccurs="0" />
<xs:element name="banFax" type="typePhone" minOccurs="0" />
<xs:element name="banEMail" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banHouseholdTotal" type="xs:unsignedByte" minOccurs="0" />
<xs:element name="banHouseholdUnder18" type="xs:unsignedByte" minOccurs="0" />
<xs:element name="banHousehold18AndOver" type="xs:unsignedByte" minOccurs="0" />
<xs:element name="banTREstateType" type="typeEstateType" minOccurs="0" />
<xs:element name="banTRInsolvencyType" type="typeInsolvencyType" minOccurs="0" />
<xs:element name="banTRAdminType" type="typeAdminType" minOccurs="0" />
<xs:element name="banTRTrusteeAppointed" type="xs:long" minOccurs="0" />
<xs:element name="banTRAdminAppointed" type="xs:long" minOccurs="0" />
<xs:element name="banTRTechnicianAppointed" type="xs:long" minOccurs="0" />
<xs:element name="banReferralSource" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banLanguagePreference" type="typeLanguage" minOccurs="0" />
<xs:element name="banSignupDate" type="typeDate" minOccurs="0" />
<xs:element name="banSignupTime" type="typeTime" minOccurs="0" />
<xs:element name="banOfficeLocation" type="xs:long" minOccurs="0" />
<xs:element name="banServiceLocation" type="xs:long" minOccurs="0" />
<xs:element name="banProcessingCentre" type="xs:long" minOccurs="0" />
<xs:element name="banInitialContact" type="typeDate" minOccurs="0" />
<xs:element name="banInitialContactTime" type="typeTime" minOccurs="0" />
<xs:element name="CauseOfBankruptcy" type="typeCauseOfBankruptcy" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="banCauseOfBankruptcyOther" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="256" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banCauseOfBankruptcyDetails" type="xs:string" minOccurs="0" />
<xs:element name="banDetails" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="128" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="banReferenceId" type="xs:long" minOccurs="0" />
<xs:element name="banIIDoneBy" type="xs:long" minOccurs="0" />
<xs:element name="Interviewer" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="typeIIBankruptsBillingNotes">
<xs:sequence>
<xs:element name="bilDate" type="typeDate" minOccurs="0" />
<xs:element name="bilType" minOccurs="0" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bilNote" type="xs:string" minOccurs="0" />
<xs:element name="bilTime" type="typeTime" minOccurs="0" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name="typeTime">
<xs:annotation>
<xs:documentation>00:23 AM , 12:12 PM</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="((0[0-9]|1[0-1]):[0-5][0-9] AM|(0[1-9]|1[0-2]):[0-5][0-9] PM|^$)" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typePhone">
<xs:restriction base="xs:string">
<xs:pattern value="([1-9][0-9]{2}[1-9][0-9]{6}|^$)" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeDate">
<xs:restriction base="xs:date">
<xs:minInclusive value="1900-01-01" />
<xs:maxInclusive value="2100-01-01" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeIIStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="Active" />
<xs:enumeration value="Inactive" />
<xs:enumeration value="ProspectiveClient" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeSex">
<xs:restriction base="xs:string">
<xs:enumeration value="Male" />
<xs:enumeration value="Female" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeMaritalStatus">
<xs:restriction base="xs:string">
<xs:enumeration value="Divorced" />
<xs:enumeration value="Married" />
<xs:enumeration value="Common-law" />
<xs:enumeration value="Separated" />
<xs:enumeration value="Single" />
<xs:enumeration value="Widowed" />
<xs:enumeration value="Unknown" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeInsolvencyType">
<xs:restriction base="xs:string">
<xs:enumeration value="Assignment" />
<xs:enumeration value="BankruptcyOrder" />
<xs:enumeration value="Proposal" />
<xs:enumeration value="Receivership" />
<xs:enumeration value="Consultation" />
<xs:enumeration value="Liquidation" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeAdminType">
<xs:restriction base="xs:string">
<xs:enumeration value="Ordinary" />
<xs:enumeration value="Summary" />
<xs:enumeration value="DivisionI" />
<xs:enumeration value="DivisionII" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeEstateType">
<xs:restriction base="xs:string">
<xs:enumeration value="Consumer" />
<xs:enumeration value="Corporate" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeLanguage">
<xs:restriction base="xs:string">
<xs:enumeration value="English" />
<xs:enumeration value="French" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="typeCauseOfBankruptcy">
<xs:restriction base="xs:string">
<xs:enumeration value="Misfortune" />
<xs:enumeration value="Inexperience" />
<xs:enumeration value="Incompetence" />
<xs:enumeration value="Carelessness" />
<xs:enumeration value="Over-expansion" />
<xs:enumeration value="UnwarrantedSpeculation" />
<xs:enumeration value="GrossNegligence" />
<xs:enumeration value="Fraud" />
<xs:enumeration value="Other" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
Gabriel Reguly answers:
Hi Tamra,
How do you want to send the file?
Via email, FTP or something else?
-Edit-
I just saw your other question, I would assume you are looking for a curl post, correct?
Regards,
Gabriel
Tamra Rich comments:
Hey Gabriel,
This is actually a different project, so i'm not sure it's related to the other post i made. I haven't really decided how i am going to end up sending it, but most likely using a curl post since i am most familiar with that. but I'd also like to know how to send it via email as-well.
Much appreciated,
Tamra
Gabriel Reguly comments:
Thanks for your answer.
So first step would be creating the file, I assume that is already known.
If not, it would be just creating a big string and saving it with http://www.php.net/manual/en/function.file-put-contents.php
Second step would be using wp_mail to send it http://wordpress.org/support/topic/wp_mailer-with-attachment
Regards,
Gabriel
Gabriel Reguly comments:
And for curl, most likely you can send the XML string instead of the file.
(At least is what a sane endpoint would experct IMHO.)
Tamra Rich comments:
ok i just confirmed that what i need is an xml file sent via email upon submission of only the fields that are named in the xsd file which is above. the form has many more fields than the xsd file, so only some of the fields need to be in the xml file if that makes sense.
can you give me a small sample code snippet of how i might go about doing this with the gravity forms hook. is it the same or similar to the way i ended up doing it in my other post?
Gabriel Reguly comments:
Ok, so it would be the [[LINK href="http://www.gravityhelp.com/documentation/page/Gform_after_submission"]]new version of the same hook[[/LINK]] as the other question
and within the function you grab the form values,
adding them to the XML string,
[[LINK href="http://www.php.net/manual/en/function.file-put-contents.php"]]save the XML string as a file[[/LINK]]
and voilá [[LINK href=" http://wordpress.org/support/topic/wp_mailer-with-attachment"]]send the email with the file attached.[[/LINK]]
(Usually XML requires UTF-8, bear that in mind.)
Hariprasad Vijayan answers:
Hello,
Following threads may help you to solve this
http://www.gravityhelp.com/forums/topic/sending-csv-attachment-on-form-submit
http://www.gravityhelp.com/documentation/page/Gform_notification
Regards,
Hariprasad