Adding multiple members to community through API - ibm-connections

I'm looking for the most efficient way to add a large number of members to a community via the API.
I can see in the community admin interface that it is possible to import a CSV of member email addresses, is there an equivalent method in the API?
I've tried just posting a feed of member entries to the standard community members endpoint, but I get a 400 response back with the message: Invalid member entry. This same endpoint works fine if I send the same entries individually.
I am posting to: /communities/service/atom/community/members?communityUuid=xxx

are you sending application/atom+xml or application/atomcat+xml as the Content-Type header?
Perhaps try this model .... ... updated to include xmlns in the entry feed
<feed> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<title type="text">Amy Jones2</title>
<id>http://communities.ibm.com:2006/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&email=ajones2#janet.iris.com</id>
<summary type="text">Amy Jones2</summary>
<link href="http://lcauto53.swg.usma.ibm.com/profiles/atom/profile.do?email=ajones2#janet.iris.com" type="application/atom+xml">
</link>
<link href="http://lcauto53.swg.usma.ibm.com/profiles/vcard/profile.do?email=ajones2#janet.iris.com" type="text/directory">
</link>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<span>
Amy Jones2
<div>
ajones2#janet.iris.com
</div>
<div class="x-guid">8af53b40-f6df-1032-9a75-d02a14283ea9</div>
<div class="x-community-role">member</div>
</span>
</div>
</content>
<published>2015-11-11T02:19:58.379Z</published>
<updated>2015-11-11T02:19:58.379Z</updated>
<contributor>
<email>ajones2#janet.iris.com</email>
<snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">8af53b40-f6df-1032-9a75-d02a14283ea9</snx:userid>
<snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
<snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal>
<name>Amy Jones2</name>
</contributor>
<link href="http://lcauto53.swg.usma.ibm.com/communities/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&userid=8af53b40-f6df-1032-9a75-d02a14283ea9" rel="self">
</link>
<link href="http://lcauto53.swg.usma.ibm.com/communities/service/atom/community/members?communityUuid=2e68aa77-216c-4029-bedf-57d513abbaba&userid=8af53b40-f6df-1032-9a75-d02a14283ea9" rel="edit">
</link>
<snx:role xmlns:snx="http://www.ibm.com/xmlns/prod/sn" component="http://www.ibm.com/xmlns/prod/sn/communities">member</snx:role>
<category term="person" scheme="http://www.ibm.com/xmlns/prod/sn/type">
</category>
<snx:orgId xmlns:snx="http://www.ibm.com/xmlns/prod/sn">a</snx:orgId>

Related

How to make error text appear underneath input field using material design components through CDN?

I am using material design through CDN to create a filled input field, but I can't create an error message below when the user doesn't write correctly for example the email, I have tried several ways importing jquery also through CDN but it does not work properly. I have tried to see the API of material design and tried to implement it but It did not work either.
Anyhelp would be really appreciated!
Thanks
<html>
<head>
<title>Parcel Sandbox</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="UTF-8" />
<link
href="https://unpkg.com/material-components-web#latest/dist/material-components-web.min.css"
rel="stylesheet"
/>
<script src="https://unpkg.com/material-components-web#latest/dist/material-components-web.min.js"></script>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<form>
<label class="mdc-text-field mdc-text-field--filled">
<span class="mdc-text-field__ripple"></span>
<input
class="mdc-text-field__input mdc-text-field-helper-text--validation-msg"
type="email"
aria-controls="validation-msg"
required
/>
<span class="mdc-floating-label" id="my-label-id">My Label</span>
<span class="mdc-line-ripple"></span>
</label>
<p
class="mdc-text-field-helper-text mdc-text-field-helper-text--persistent mdc-text-field-helper-text--validation-msg"
role="alert"
>
Enter Valid Email
</p>
</form>
<script>
mdc.textField.MDCTextField.attachTo(
document.querySelector(".mdc-text-field")
);
</script>
</body>
</html>```
https://codesandbox.io/s/admiring-elion-kojst?file=/index.html
First off, jQuery wasn't needed. It didn't give any errors and it behaved the same, so I just removed it.
I found the manual here: https://material.io/develop/web/components/text-fields
If you look at the section titled:
Text field with helper text
Here you can seen the following example:
<label class="mdc-text-field mdc-text-field--filled">
<span class="mdc-text-field__ripple"></span>
<input class="mdc-text-field__input" type="text"
aria-labelledby="my-label-id"
aria-controls="my-helper-id"
aria-describedby="my-helper-id">
<span class="mdc-floating-label" id="my-label-id">My Label</span>
<span class="mdc-line-ripple"></span>
</label>
<div class="mdc-text-field-helper-line">
<div class="mdc-text-field-helper-text" id="my-helper-id" aria-hidden="true">helper text</div>
</div>
If you look carefully at the after the label, you will see some differences.
There is even more detailed information on how to use the helper text:
https://github.com/material-components/material-components-web/tree/v7.0.0/packages/mdc-textfield/helper-text/
In the API section there is a class called mdc-text-field-helper-text--persistent which you have included. This will make the helper text permanently visible, so you don't want that.
Here is the block you should have instead of the p element after the label:
<div class="mdc-text-field-helper-line">
<div class="mdc-text-field-helper-text mdc-text-field-helper-text--validation-msg">
Enter Valid Email
</div>
</div>
PS: would be great if you could include a link to the example you were following next time.

Strange behaviour from Font awesome 5

I am new to the use of Font Awesome (using v5 at the moment), and I have come across something strange on my page.
I have the reference to Font Awesome in my tags:
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
I have also successfully used icons on my pages of my site, however, in one case, I only get three empty square where the icons should appear.
The code for the offending items is as follows:
<div class="social">
<i class="fas fa-facebook fa-4x"></i><a href="http://twitter.com/RadioVlNationaa"
target="_blank"><i class="fas fa-twitter fa-4x"></i></a><a href="http://youtube.com/user/RadioVlaanderenNatio"
target="_blank"><i class="fas fa-youtube fa-4x"></i></a>
</div>
The strange thing is, I put, as a means of test, an icon elsewhere in the same page (just with the tags) and it worked with no issue at all.
I assume it has something to do with the hyperlink, but what?
As I said, anywhere else on my site, the icons work good as gold.
Could someone help me out, please?
Thank you in advance.
You had mistake "fas" it should "fab":
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" integrity="sha384-+d0P83n9kaQMCwj8F4RJB66tzIwOKmrdb46+porD/OvrJ+37WqIM7UoBtwHO6Nlg" crossorigin="anonymous">
<div class="social">
<i class="fab fa-facebook fa-4x"></i><a href="http://twitter.com/RadioVlNationaa"
target="_blank"><i class="fab fa-twitter fa-4x"></i></a><a href="http://youtube.com/user/RadioVlaanderenNatio"
target="_blank"><i class="fab fa-youtube fa-4x"></i></a>
</div>

Google Actions Implementation

I am currently running an ecommerce store. I want to use google actions & reviews in my emails so I can get reviews and offer one click actions from there. I am pretty novice, and have found this very useful. Can any body please help with how to get started? What are the requirements? Are there any email related requirements as SPF, DKIM , DMARC etc?
I would be very thankful for this support
I recently had similar questions myself because we wanted to provide shipment tracking information integrated in Google Now and jotted down the process I had to go through.
Since you want to offer the ability to post reviews your process will be a little different (as is described here: Review Action Email Markup - Google Developers) and needs a backend to handle HTTP POST requests.
Saxed from my blog about my journey to get tracking actions up and running:
Implement the Microdata schema in our email templates according to the Google Developer examples for the Parcel Delivery
action.
We went with the basic option to keep things simple. (See end results
further down this page)
Validate the data. Fail
validation.
Realize that the format in the examples was invalid (according to Google's own validator)
Tweak the tags and add one or two missing ones.
Validate again. Pass.
Verify that we have DKIM keys set up for the sender domain(s).
Send an email from our customer service email address to the same address to verify the button works (it wont work for other recipients
until Gmail whitelists you)
Send another email, to Google this time. This is part of the registration process.
Fill in the registration form
so that Google's people can validate your schema.
Receive reply from Google that they've forwarded my email to the right people.
???
It took 3 working days (Wednesday to Monday) and then I got an email from Google saying we were live.
We use Mandrill and their template feature. The template ended up with this metadata in the bottom, leaving the rest of the markup untouched:
<body>
{{-- lots of tables for layout --}}
<div itemscope itemtype="http://schema.org/ParcelDelivery">
<div itemprop="deliveryAddress" itemscope itemtype="http://schema.org/PostalAddress">
<meta itemprop="streetAddress" content="{{ deliveryAddressStreet }}"/>
<meta itemprop="addressLocality" content="{{ deliveryAddressCity }}"/>
<meta itemprop="addressRegion" content="{{ deliveryAddressCountry }}"/>
<meta itemprop="addressCountry" content="{{ deliveryAddressCountry }}"/>
<meta itemprop="postalCode" content="{{ deliveryAddressZip }}"/>
</div>
<meta itemprop="expectedArrivalUntil" content="{{ expectedDelivery }}"/>
<div itemprop="carrier" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="{{ carrier }}"/>
</div>
{{#each products}}
<div itemprop="itemShipped" itemscope itemtype="http://schema.org/Product">
<meta itemprop="name" content="{{ description }}"/>
</div>
{{/each}}
<div itemprop="partOfOrder" itemscope itemtype="http://schema.org/Order">
<meta itemprop="orderNumber" content="{{ ordernumber }}"/>
<div itemprop="merchant" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="Our Store Name"/>
</div>
<link itemprop="orderStatus" href="http://schema.org/OrderInTransit"/>
</div>
<meta itemprop="trackingNumber" content="{{ shipmentTrackingNo }}"/>
<link itemprop="trackingUrl" href="{{ shipmentTrackingLink }}"/>
<div itemprop="potentialAction" itemscope itemtype="http://schema.org/TrackAction">
<link itemprop="target" href="{{ shipmentTrackingLink }}"/>
<link itemprop="url" href="{{ shipmentTrackingLink }}"/>
<meta itemprop="name" content="Track shipment"/>
</div>
</div>
</body>

SVG images in AMP article Microdata?

When attempting to validate a schema.org/Article against Google's Structured Data Testing Tool, I noticed that it gives an error if you specify an SVG image:
The value provided for logo must be a valid URL.
Required by:
AMP Articles (what's this?)
When the URL is changed to have a .png (or .jpg, .bmp, .webp, etc.) extension, rather than .svg, it passes validation.
Here is the example I'm working with:
<div itemscope itemtype="http://schema.org/Article">
<div itemprop="publisher" itemscope itemtype="https://schema.org/Organization">
<meta itemprop="name" content="Example" />
<meta itemprop="url" content="http://example.com" />
<div itemprop="logo" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="http://example.com/logo.svg" />
<meta itemprop="width" content="600" />
<meta itemprop="height" content="60" />
</div>
</div>
<meta itemprop="dateModified" content="2016-01-05T12:43" />
<meta itemprop="datePublished" content="2016-01-05T12:43" />
<meta itemprop="headline" content="Example" />
<meta itemprop="name" content="Example" />
<meta itemprop="author" content="Example" />
<link itemprop="mainEntityOfPage" href="http://example.com/article" />
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<meta itemprop="url" content="http://example.com/article.jpg" />
<meta itemprop="width" content="1200" />
<meta itemprop="height" content="800" />
</div>
</div>
Changing the other image's URL's extension will also produce the error.
I was unable to find any information on why it rejects SVGs in the Rich Snippets documentation or the AMP HTML spec. Does anyone have an explanation for this behavior?
Google has updated the documentation and specifically mentioned svg.
Logo image files should be raster (for example, .jpg, .png, .gif), not vector (for example, .svg), with no animation.
From one of the links you gave: https://developers.google.com/structured-data/rich-snippets/articles
Images should be in .jpg, .png, or. gif format.
Why? Who knows. Perhaps because SVGs still have some support issues in some browsers (particularly older ones).
Update: 2022 - after reading the google documentation, it seems they do now accept svgs. https://developers.google.com/search/docs/appearance/structured-data/logo#structured-data-type-definitions

How to automatically show Title of the Entries/Articles in the Browser Title Bar in ExpressionEngine 2?

How would I output the title of an entry in ExpressionEngine and display it in the browser's title bar?
Here is the content of my page's header:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Site</title>
<link rel="stylesheet" href="{stylesheet=site/site_css}" type="text/css" media="screen" />
</head>
What I need is for each page to display the title of the entry in my browser's title bar — how can I achieve that?
Part of UPDATED Code:
Here is how i have done it :
{exp:channel:entries channel="news_articles" status="open|Featured Top Story|Top Story" limit="1" disable="member_data|trackbacks|pagination"}
{embed="includes/document_header" page_title=" | {title}"}
<body class="home">
<div id="layoutWrapper">
{embed="includes/masthead_navigation"}
<div id="content">
<div id="article">
<img src="{article_image}" alt="News Article Image" />
<h4>{title}</h4>
<h5><span class="by">By</span> {article_author}</h5>
<p>{entry_date format="%M %d, %Y"} -- Updated {gmt_edit_date format="%M %d, %Y"}</p>
{article_body}
{/exp:channel:entries}
</div>
What do you think?
Another relatively new way to tackle it is using the Stash add-on and a template partials approach. This method knocks you down to one embed, and has the added advantage of giving you a centralized "wrapper" template - one for each major page layout, basically. The example below assumes you've simply added custom fields to handle any entry-specific meta data you're looking to inject into the header. With this idea in mind, here's a simplified view of the basic structure I've been applying recently:
In your template you apply EE tags to determine the logic of what gets sent to the inside-wrapper
{embed="embeds/.inside-wrapper"}
{exp:channel:entries channel="channel_name" limit="1" dynamic="yes" disable="whatever|you|can|live|without"}
{!-- ENTRY SEO META DATA --}
{exp:stash:set name="entry_seo_title" scope="site"}{cf_channelprefix_seo_title}{/exp:stash:set}
{exp:stash:set name="entry_seo_description" scope="site"}{cf_channelprefix_seo_description}{/exp:stash:set}
{exp:stash:set name="entry_seo_keywords" scope="site"}{cf_channelprefix_seo_keywords}{/exp:stash:set}
{!-- ENTRY/PAGE CONTENT --}
{exp:stash:set name="entry_body_content" parse_tags="yes" parse_conditionals="yes" scope="site"}
Your page content here
{/exp:stash:set}
{/exp:channel:entries}
And then in your wrapper template, which would ultimately contain all your wrapping HTML but could be chunked into snippets. for something like the header since it would be shared with other wrapper templates, for example:
<html>
<head>
<title>{exp:stash:get name="entry_seo_title"}</title>
<meta name="description" content="{exp:stash:get name="entry_seo_description"}" />
<meta name="keywords" content="{exp:stash:get name="entry_seo_keywords"}" />
</head>
<body>
{exp:stash:get name="entry_body_content"}
</body>
</html>
If you want to show just the name of your ExpressionEngine site (as defined in CP Home > Admin > General Configuration) use the site name global variable:
<title>{site_name}</title>
If you want to display just the current entry title from a given channel use the following:
<title>
{exp:channel:entries channel="channel_name" limit="1" dynamic="yes"}
{title}
{/exp:weblog:entries}
</title>
Many Web Developers will use an Embed Variable with an Embedded Template to pass the `{entry_title} to a global embed template, allowing for a dynamic page title:
{embed="includes/header" title="{exp:channel:entries channel="{channel_name}"}{title}{/exp:channel:entries}"}
If you're using EE2, the SEO Lite Module takes care of all the hard work for you with a single line of code:
<html lang="en">
<head>
<meta charset="utf-8" />
{exp:seo_lite url_title="{url_title}"}
</head>
Other solutions include the Low Title Plugin (EE1, EE2).
One addition to Ryan's embed method (which is definitely the most flexile method): chances are you can wrap most of your page in an {exp:channel:entries} tag when viewing an individual entry, avoiding the additional (and expensive) channel:entries call. So it would look more like this:
{exp:channel:entries channel="channel_name" limit="1"}
{embed="includes/header" title="{title}"}
<h1>{title}</h1>
{page_content}
{embed="includes/footer"}
{if no_results}{redirect="404"}{/if}
{/exp:channel:entries}
NSM Better Meta is a more complete way to pass channel meta data to the tag.
For smaller sites, I use the String plugin.
https://devot-ee.com/add-ons/string
Very simple syntax.

Resources