Skip to content

Commit

Permalink
Adding email property to the ContactPoint type (#1069)
Browse files Browse the repository at this point in the history
Co-authored-by: Gary Meehan <[email protected]>
  • Loading branch information
sam-meehan7 and garmeeh authored Nov 9, 2022
1 parent 144c171 commit f857eb5
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 8 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1428,12 +1428,14 @@ const Page = () => (
{
telephone: '+1-401-555-1212',
contactType: 'customer service',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
},
{
telephone: '+1-877-746-0909',
contactType: 'customer service',
email: '[email protected]',
contactOption: 'TollFree',
availableLanguage: 'English',
},
Expand Down Expand Up @@ -1467,6 +1469,7 @@ export default Page;
| -------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `contactPoint.areaServed` | `String` or `Array` of geographical regions served by the business. Example `"US"` or `["US", "CA", "MX"]` |
| `contactPoint.availableLanguage` | Details about the language spoken. Example `"English"` or `["English", "French"]` |
| `contactPoint.email` | Email asscosiated with the business` |
| `gecontactPointo.contactOption` | Details about the phone number. Example `"TollFree"` |

### FAQ Page
Expand Down Expand Up @@ -2988,12 +2991,14 @@ export default () => (
{
telephone: '+1-401-555-1212',
contactType: 'customer service',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
},
{
telephone: '+1-877-746-0909',
contactType: 'customer service',
email: '[email protected]',
contactOption: 'TollFree',
availableLanguage: 'English',
},
Expand Down Expand Up @@ -3038,6 +3043,7 @@ export default () => (
| `address.streetAddress` | Street number, street name, and unit number. |
| `contactPoint.areaServed` | `String` or `Array` of geographical regions served by the business. Example `"US"` or `["US", "CA", "MX"]` |
| `contactPoint.availableLanguage` | Details about the language spoken. Example `"English"` or `["English", "French"]` |
| `contactPoint.email` | Email asscosiated with the business` |

For reference and more info check [Docs](https://schema.org/Organization)

Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/corporateContact.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ describe('DataSet JSON-LD', () => {
{
'@type': 'ContactPoint',
telephone: '+1-401-555-1212',
email: '[email protected]',
contactType: 'customer service',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
},
{
'@type': 'ContactPoint',
telephone: '+1-877-746-0909',
email: '[email protected]',
contactType: 'customer service',
contactOption: 'TollFree',
availableLanguage: 'English',
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/organization.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ describe('Organization JSON-LD', () => {
'@type': 'ContactPoint',
contactType: 'customer service',
telephone: '+1-877-746-0909',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
contactOption: 'TollFree',
Expand Down Expand Up @@ -80,6 +81,7 @@ describe('Organization JSON-LD', () => {
'@type': 'ContactPoint',
contactType: 'customer service',
telephone: '+1-877-746-0909',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
contactOption: 'TollFree',
Expand Down
5 changes: 5 additions & 0 deletions cypress/schemas/contactPoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ const contactPoint100 = {
type: 'string',
description: 'Telephone number of the company',
},
email: {
type: 'string',
description: 'Email of the company',
},
contactType: {
type: 'string',
description: 'The main usage of the phone number',
Expand All @@ -42,6 +46,7 @@ const contactPoint100 = {
'@type': 'ContactPoint',
contactType: 'customer service',
telephone: '+1-877-746-0909',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
contactOption: 'TollFree',
Expand Down
2 changes: 2 additions & 0 deletions e2e/pages/jsonld/corporateContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ function CorporateContact() {
{
telephone: '+1-401-555-1212',
contactType: 'customer service',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
},
{
telephone: '+1-877-746-0909',
contactType: 'customer service',
email: '[email protected]',
contactOption: 'TollFree',
availableLanguage: 'English',
},
Expand Down
3 changes: 2 additions & 1 deletion e2e/pages/jsonld/organization/multipleAddresses.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ function MultipleAddresses() {
addressCountry: 'France',
},
]}
contactPoints={[
contactPoint={[
{
contactType: 'customer service',
telephone: '+1-877-746-0909',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
contactOption: 'TollFree',
Expand Down
1 change: 1 addition & 0 deletions e2e/pages/jsonld/organization/organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function Organization() {
{
contactType: 'customer service',
telephone: '+1-877-746-0909',
email: '[email protected]',
areaServed: 'US',
availableLanguage: ['English', 'Spanish', 'French'],
contactOption: 'TollFree',
Expand Down
8 changes: 1 addition & 7 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export interface Organizer {
export interface ContactPoint {
contactType: string;
telephone: string;
email?: string;
areaServed?: string | string[];
availableLanguage?: string | string[];
contactOption?: string | string[];
Expand All @@ -137,13 +138,6 @@ export interface Producer {
name: string;
url?: string;
}
export interface ContactPoint {
contactType: string;
telephone: string;
areaServed?: string | string[];
availableLanguage?: string | string[];
contactOption?: string | string[];
}

export interface Question {
questionName: string;
Expand Down

0 comments on commit f857eb5

Please sign in to comment.